FTP Batch Script

By | July 18, 2006

Do you need to repeatedly perform a file copy to an FTP server, but don't want to take the time to manually do it each day.
This batch file will open up an FTP connection to a server of your choice and copy files to it.

This batch script will require two files.

The first one is the batch file that opens the FTP.

save it as backup.bat

 

———-COPY EVERYTHING BELOW THIS LINE———-

cd ..
cd ..
ftp -i  -s:com.txt <IP ADDRESS OF THE FTP SERVER HERE>

———-COPY EVERYTHING ABOVE THIS LINE———-

 

Next you'll need a txt file for the ftp commands.
Copy the text below into notepad and name the file com.txt

———-COPY EVERYTHING BELOW THIS LINE———-

YOUR LOGIN NAME HERE
YOUR PASSWORD HERE

cd "my documents"
mput "c:\my documents\*.*"
cd "tom's folder"
mput "c:\my documents\tom's folder\*.*"
cd ..
cd  new
mput "c:\my documents\new\*.*"
cd ..
cd ..
cd pci
mput c:\pci\*.*
quit

———-COPY EVERYTHING ABOVE THIS LINE———-

 

Place these file on the root of C: to use and
PLEASE MAKE SURE NO WORD WRAPPING IS HAPPENING IN NOTEPAD!!!

*the mput command copies multiple files

This information is provided "AS IS" with no warranties expressed or implied.

Leave a Reply

Your email address will not be published. Required fields are marked *