FTP Batch file

Microsoft Windows xp professional w/serv...
April 14, 2010 at 09:30:47
Specs: Windows XP
I want to setup a batch file to connect to different ftp sites and download files to individual folders. Right now I'm trying to use "ftp -s:DosFtpFile.ftp www.server.com" inside a batch file, and use "user_name, password, prompt, mget *, quit" inside of the dosftpfile.ftp file. It works for the first one, but then stops.

See More: FTP Batch file

Report •


#1
April 14, 2010 at 17:40:08
remove the servername from your commandline, just do:
ftp -s ftpfile
and in the ftpscriptfile:
open servername1
username
password
mget *
disconnect
open servername2
username
password
mget *
disconnect
...
one set of open..disconnects for each server, and add other commands as needed within each subset (cd, binary etc).

Report •

#2
April 14, 2010 at 23:51:16
>ftpscript.txt echo open %2
>>ftpscript.txt echo %user%
>>ftpscript.txt echo %password%
>>ftpscript.txt echo ascii
>>ftpscript.txt echo cd %3
>>ftpscript.txt echo get %4
>>ftpscript.txt echo bye

ftp -s:ftpscript.txt

Try by doing like this. It works


Report •

#3
April 15, 2010 at 05:13:07
No point in setting ascii.


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
April 16, 2010 at 03:17:39
> No point in setting ascii.
>

Programming clarity


Report •

#5
May 3, 2010 at 15:54:34
ok. I've got the file running. It goes to multiple ftp sites. It downloads the files I want, puts their name into a text file, deletes them from the ftp site, and moves on. Thanks for the help.

Report •

Ask Question