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.
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).
>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 byeftp -s:ftpscript.txt
Try by doing like this. It works
No point in setting ascii.
=====================================
Helping others achieve escape felicityM2
> No point in setting ascii.
>Programming clarity
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.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |