Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with batch file

Status
Not open for further replies.

le1234

Technical User
May 12, 2006
30
0
0
GB
i would like to create a batch file that connects to an ftp area and picks up a txt file and places in a directory specifed on the C drive....anyone help with the code required... I have made a start but all it does is load ftp via cmd prompt. Any help would be really appreciated - I need to know how I tell it where to put the file it is picking up!


ftp ftpservername
user
password
cd /test
get module.txt
bye
 
You'll need to place all your FTP commands in a separate file, and then have the batch file call it:


Code:
ftp -i -s:path\to\command\file.ftp

Code:
OPEN ftpservername
user
password
get filename destination\filename
quit


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
just remember that this is a plain text file and your user name and password will not be encrypted.
regards,
longhair
 
great thanks for the help - this has worked for me.
can i asked what are the -i and -s switches?
thanks again for your help
 
no worries I found what I was looking for:
-i Turns off interactive prompting during multiple file transfers.
-s:filename Specifies a text file containing FTP commands; the commands will automatically run after FTP starts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top