How do I download files and folders to a local machine via cmd or bat file?

8,069

Solution 1

You could use a PowerShell option to perform this task a premade function already exist Here. http://powershell.com/cs/media/p/804.aspx

All you would need to run is:

Get-FTPFile -Source "ftp://server/path" -Target "C:\temp" -UserName "Username" -Password "P@ssw0rd"

Solution 2

There is an command-line FTP client which comes with Windows (at least XP). I think it is called just ftp. Here (in the ftp link) is its documentation on the Microsoft web site (at least for the Windows XP version).

Share:
8,069
karm
Author by

karm

Updated on September 17, 2022

Comments

  • karm
    karm almost 2 years

    I want to download all of my remote files and folders from an ftp server to my local machine using the command line or a '.bat' file.

  • barlop
    barlop almost 13 years
    -1 he said cmd or bat and you speak of drag and drop. You should've said this doesn't answer it, and perhaps written it in a comment.
  • Synetech
    Synetech almost 13 years
    @barlop, I clearly said it would be easiest. Re-read the question; he says nothing to indicate that the command-line is actually required, so using a GUI would indeed be easier.
  • barlop
    barlop almost 13 years
    He said via cmd or bat file, you think that can mean GUI?
  • Synetech
    Synetech almost 13 years
    I know what he said, but that doesn’t make it a necessity. Once again, I clearly said that using a GUI would be easier, so it is up to him to expound on their requirements and clarify if a CLI is actually needed.
  • barlop
    barlop almost 13 years
    What you mean is it's up to him if he wants to change his question to include how to do it in a GUI(an unlikely question since it's fairly obvious, especially to somebody that can ask the question he did). expounding his requirements to include GUI would be different to what he asked, and would be changing the question. You are answering a different question. It's like if somebody asks How do I do X in Y, and you tell him how to do X in Z. It's a suggestion rather than an answer.
  • barlop
    barlop almost 13 years
    Secondly, it'd be very annoying, if any time somebody wanted to ask How do I do X in Y, if they actually wanted an answer of how to do X in Y, it'd be very annoying if they had to state I NEED it in Y, and REQUIRE it only in Y.If they say in Y/they want it in Y, it should be enough to get that question across.Anyhow, it makes perfect sense to want it in a batch rather than a GUI.If you knew of ways to automate it in a GUI and perhaps invisibly too,or at least automate it, somewhat like the benefits of a batch)then that may justify itself as an "alternative" to a batch/cmd or may be a cmd
  • barlop
    barlop almost 13 years
    I know some people sometimes don't know what they want, and they ask how to do X in Y, when they mean how to do X, but to say how to do it in Z, is a suggestion, unless they change their question. But if they ask how to do it in Y, they don't have to convince you that they need to do it in Y, in order to be answered how to do it in Y. If they ask how to do it in Y, that's the question.
  • Synetech
    Synetech almost 13 years
    Funny how you’re the only one complaining; the OP hasn’t complained one wit.
  • barlop
    barlop almost 13 years
    @Synatech inc I'm not complaining, i'm critiquing, it takes balls, brains, and emotional detachment and many aren't capable of doing it for lack of that combination. Also the OP seems to be a quiet fellow- rep of 6, who hasn't been seen for about 6 months.
  • Synetech
    Synetech almost 13 years
    Exactly. If he were as adept as you inferred, chances are he would have returned to examine the answers. Plus, it sounds like he was asking for a way to copy his stuff from a hosted server, which would not require it to be done from the command-line, so is not a stretch to think that perhaps a GUI would be easier for them.
  • barlop
    barlop almost 13 years
    he doesn't have to say he requires x to say he wants it in x. you're reading the question more generically than he asked it. Is it a stretch to think he might prefer a GUI or be more informed by being told that such a thing exists, I think it is, but even if it isn't a stretch. he doesn't have to say he requires x to say he wants it in x. if you give it to him in y because he says he wants it in x but didn't say he requires it in x then your answer may be of value, like if he'd never heard of y,but it still would be a suggestion rather than an answer, unless he made his question more generic
  • Synetech
    Synetech almost 13 years
    It’s because the comments are not A B A B; you keep talking so much that you have to break it up into multiple comments in a row, which breaks the pattern, so it doesn’t trigger.
  • barlop
    barlop almost 13 years
    this one went ABABA then appeared superuser.com/questions/112136/… but the q/a on this page has done ABABA twice and still nothing.
  • barlop
    barlop almost 13 years