Return to Snippet

Revision: 10114
at December 8, 2008 23:27 by jimfred


Initial Code
echo lcd c:\DestDir >  ftpcmd.txt &
echo get File.txt   >> ftpcmd.txt &
echo quit           >> ftpcmd.txt &
ftp -A -s:ftpcmd.txt -n -v 192.168.2.132

Rem similar to wget ftp://192.168.2.132/File.txt

Initial URL


Initial Description
ftp from the command line - Here's an example, similar to a wget ftp://192.168.2.132/File.txt, all on one line but broken into several lines here for readability:

Commands are delimited using DOS/Window's &. Optionally, the first command could be a del File.txt.

The echo commands create a temporary file, ftpcmd.txt, with three commands:

   1. lcd (a local cd to change the local directory),
   2. a get command to perform the file transfer
   3. a quit to exit from the ftp prompt

ftp's command line parameters:

   1. -A login anonymously
   2. -s specifies a command file
   3. optional -n and -v suppress printed messages
   4. ...and the ftp server's ip address.

Initial Title
ftp from the command line - similar to wget

Initial Tags


Initial Language
DOS Batch