PDA

View Full Version : Batch programming with ftp



bcarl314
02-14-2003, 03:16 PM
I want to create a batch file that will log into a ftp server and grab some files. I want be able to pass an argument to the batch file that will tell the ftp program what files I want.

example
c:\> myBatchFile *.html

will get all the .html files from the server.

myBatchFile looks like this:


ftp -i -s:login.txt


and the file login.txt looks like:


open 127.0.0.1
username
password
cd
/usr/var/html


now where do I put in the argument I want to pass from the command line so the program will get the *.html files?

If I add a line like
mget %1 to the batch file it does nothing
same if I add it to the login.txt file.

Any ideas?

joh6nn
02-14-2003, 06:38 PM
http://www.google.com/search?q=batch+tutorial&sourceid=mozilla-search&start=0&start=0
http://www.merlyn.demon.co.uk/batfiles.htm
http://gatsby.tafe.tas.edu.au/batch/

that third link looks the most promising.