FTP file launch from a batch file

M

Michael Medipor

I want to launch FTP from a batch file so that by running
the batch file I:

1. ftp to the site - ie.. ftp.mydomain.com
2. Login as a user - ie.. Login: username
3. enter my password - ie.. password: mypassword
4. execute a put command - ie.. put myfilename.txt
5. quit from the ftp session
6. close the command prompt screen.

Any suggestions as to the syntax I should use?

Thanks.
 
R

Ray at

Create a file named something like C:\ftpscript.ftp (file extension doesn't
matter). Give it contents as so:


open xxx.xxx.xxx.xxx
user REPLACETHISWITHYOURUSERNAME
REPLACETHISWITHYOURPASSWORD
type ascii
lcd D:\LocalDirectory
cd RemoteDirectory
put textfile.txt
type binary
put binaryfile.gif
! net send %computername% Files updloaded
close
quit


Put this in a file named ftpit.bat.

%windir%\system32\ftp.exe -n -s:C:\ftpscript.ftp


Double click the .bat file.

Ray at work
 

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

Top