FTP commands from batch file

  • Thread starter Thread starter Michael Lawson
  • Start date Start date
M

Michael Lawson

I need to come up with a batch file that will execute commands to connect
and login to an ftp server, retreive a file, modify the file and put it back
on the ftp server. The command to connect to the ftp server, pass a user id
and password seem to be straight forward enough; it's the ftp command
execution after the ftp shell runs that I'm not sure of. Any ideas?

Thanks, Mike Lawson
 
Michael Lawson said:
I need to come up with a batch file that will execute commands to connect
and login to an ftp server, retreive a file, modify the file and put it back
on the ftp server. The command to connect to the ftp server, pass a user id
and password seem to be straight forward enough; it's the ftp command
execution after the ftp shell runs that I'm not sure of. Any ideas?

Thanks, Mike Lawson

Try this:

@echo off
set account=MLawson
set password=Mike
set script=c:\script.scr

echo %account%>%script%
echo %password%>>%script%
echo binary>>%script%
echo get somefile.txt >> %script%
echo quit >> %script%

ftp -s:%Script% ftp.someftpsite.com

del %script%
 
Back
Top