FTP commands from batch file

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
 
P

Pegasus \(MVP\)

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%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top