Posted By

jimfred on 12/08/08


Tagged

FTP dos wget


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tyster
thastyle


ftp from the command line - similar to wget


 / Published in: DOS Batch
 

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.
  1. echo lcd c:\DestDir > ftpcmd.txt &
  2. echo get File.txt >> ftpcmd.txt &
  3. echo quit >> ftpcmd.txt &
  4. ftp -A -s:ftpcmd.txt -n -v 192.168.2.132
  5.  
  6. Rem similar to wget ftp://192.168.2.132/File.txt

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: hemanthhm on January 11, 2009

More tips and tricks :: http://ubunt2.blogspot.com/2009/01/wget-tircks-and-tips.html

You need to login to post a comment.