Batch file for FTP login

jccorner

Centurion
Joined
Jan 31, 2004
I've recently been presented with the task of getting a file from a FTP/SSL location automatically for a nightly feed. Thus far I've been able to manually do this using MoveIt Freely software that I downloaded and am are able to perform the necesary commands via command line. Now I'm trying to mimic the commands by running a batch file. For example in my batch file, I have:

Code:
ftps -e:on -a url -user:username -password:password
cd General
get file1.txt C:\My Documents\file2.txt

Problem is it executes to login perfectly but then the command tool stays up and never executes the change directory command. I can't seem to find out how to make it execute the second line of the batch file after it logs in. Appreciate any assistance. Also, if someone knows of a better way of performing this task, by all means, suggest a way. Thanks again.
 

mskeel

Senior Contributor
Joined
Oct 30, 2003
Try making a .ftp file instead of a .bat file. Then put the commands into the .ftp file directly as you would as if you were using ftp on the command line.

Code:
open [url]www.myServer.com[/url]
username
password
cd General
mget file1.txt C:\My Documents\file2.txt
...
quit
 
Top Bottom