How to set up a simple FTP download batch job

G

Guest

Hello,

I am a FTP newbie. I would like to set up a batch job to automatically
download files from an FTP site to my XP machine. I believe that a .txt file
and Windows Scheduler are all that is needed, but I am not sure and have no
idea how to write the script, etc.

Can anyone help and show script examples? Thanks in advance.
 
F

frodo

nathan said:
I am a FTP newbie. I would like to set up a batch job to automatically
download files from an FTP site to my XP machine. I believe that a .txt file
and Windows Scheduler are all that is needed, but I am not sure and have no
idea how to write the script, etc.
Can anyone help and show script examples? Thanks in advance.

look up the syntax for the ftp command in Help and Support (if you have
XP Pro; if Home then look online at
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx
)

here's an example FTP command line:

%windir%\System32\ftp.exe -n -s:"C:\MY FTP SCRIPT.TXT"

inside the script file (C:\MY FTP SCRIPT.TXT) put the ftp commands, one
per line:

open remoteftpsite.com
user john johnspassword
quote pasv
prompt
binary
lcd "c:\documents and settings\john\my documents\ftp downloads"
cd /usr/john/remotedirectorypath
dir
mget *
bye

=========

you could also use a third party ftp utility, there are many free ones out
there.
 
G

Guest

Thanks for your repsonse. Seems pretty straightforward. Couple more
questions: can you explain the "quote pasv" line in your example? And is
there a way to rename the file being downloaded to include a time stamp in
the file name. Much appreciated.
 
Joined
Nov 30, 2011
Messages
1
Reaction score
0
open ftp:username:password@ip_of_server:21
option batch on
option confirm off
option exclude "*.csv" (if you want to exclude any particular extension files)

option transfer binary
cd /path of FTP server folder/
lcd "path of local folder"
get *.format of the file (for exp: .gz for compressed file,.csv for csv files etc)
exit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top