ftp.exe is a command line tool that you use to connect to ftp servers. What is not very widely known about this tool is that it allows you to automate an ftp session by supplying a script which has the relevant ftp commands.
Let’s say we need to logon to the host – ftp.yourhost.com and download all the files in the dump directory on the server, we would first create a simple text file – say commands.txt which look something like this:
o ftp.yourhost.com
user username
pass password
cd dump
bin
prompt
mget *.*
close
quit
Then when using ftp.exe from command prompt, we can supply this text file as an argument to it:
ftp –s:commands.txt
that should do it!
Also see:
Using FTP Batch Scripts Related...
http://devfun.blogspot.com/2005/01/automating-ftpexe-sessions.html