3
1
I am trying to download all of the files in a directory using the FTP command on Windows (Windows Server 2012 R2). Here is what I am running from the ftp command:
open myurl.com
myusername
mypassword
cd directoryIwantonExternalServer
lcd directoryIwantonLocalmachine
binary
mget *.*
Everything seems to work fine until the last line, when running mget *.*
. This results in no output for an indefinite period. I am only trying to transfer as a test two text files.
I don't think windows' ftp client is any good at all. Like it won't probably support passive mode either. If someone confirms it, the only workaround would be to use another FTP client or maybe create in the server an index file which contains the filenames to be downloaded. – LatinSuD – 2015-02-05T18:58:29.823
I'm wanting to automate downloading files in a batch script eventually across multiple computers. This seems like it could be the easiest solution, as it's the most universal (doesn't require additional software, inc. PS). – Jake – 2015-02-05T19:01:34.977
2Have you try to enter before mget the command prom? – Romeo Ninov – 2015-02-05T19:15:50.260
Pressing enter to make a blank line before running mget worked. Thanks Romeo! Feel free to make it an answer and I will accept it. No clue why that worked... – Jake – 2015-02-05T20:06:49.890
@RomeoNinov 's answer works because you are essentially setting variables. Things like your user name, password, the paths to the servers -- those need to be set before calling the mget .. Otherwise, you get the result you are getting. Think of it like a "GO" is SQL Server. Some stuff needs to execute before the other commands will function. – Kevin R. – 2015-02-12T23:51:16.843