Tech Support > Microsoft Windows > How to set up a simple FTP download batch job
How to set up a simple FTP download batch job
Posted by nathan on January 18th, 2006


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.

Posted by frodo@theshire.org on January 18th, 2006


nathan <nathan@discussions.microsoft.com> wrote:
> 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/d...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.

Posted by nathan on January 18th, 2006


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.

"frodo@theshire.org" wrote:

> nathan <nathan@discussions.microsoft.com> wrote:
> > 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/d...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.
>


Similar Posts