FTP Scripting?

yodafett

Blissfully wed to tierajade
Oct 12, 2006
6,095
952
46
✟23,403.00
Faith
Christian
Marital Status
Married
yes, I'm running it from a .bat file (tried manually entering at CLI, as well, to same results) Just plain FTP commands from a Windows Server 2008 R2 box.

edited script below. Aside from the <> details, the script is exactly as below. Worked fine for months pulling files from a server in our company's DMZ to a central Operations server. Now it doesn't. It runs as domain admin on the operations server as a Scheduled Task. It Authenticates fine, and does the change directory fine. As soon as it hits the first mget, it just stalls... doesn't error, doesn't freeze, just sits like it's working, and never does anything. Flashing cursor - the end. I've tried replacing "mget" with "get" and "recv" to the exact same result. I do it manually from command line, line by line it's totally fine, until the first copy command. Have even tried changing the local destination folders, just to check permissions.





open <ip address>
<user>
<password>
prompt n
lcd \\<local destination file path>
mget *.txt
mget *.doc
mget *.pdf

bye
 
Last edited:
Upvote 0

yodafett

Blissfully wed to tierajade
Oct 12, 2006
6,095
952
46
✟23,403.00
Faith
Christian
Marital Status
Married
firewall issue. *facepalm* I was expecting that since it was authenticating and allowing commands through, it was ok, but I have been recently informed that while the FTP "control" commands go over port 21, the "Data" is piped over high port #s. Create Firewall exception for ftp.exe, restrict to remote IP x.x.x.x, apply, script runs like a charm. Such a rookie mistake, lol
 
Upvote 0