Wednesday 16 January 2013

Automate FTP file copy - Batch Script

To Automate FTP file copy create two files, Import.bat and Script.txt rename to scr when finished editing (Script.scr)

Import.bat

REM @echo off
cd\
C:\



del importedfile
ftp -s:
Script.scr
ping 127.0.0.1 -n 4 -w 1000 REM use ping to delay the copy of ftp file
xcopy C:\
importedfile   \\destination\share   /Y


Script.scr

open ftpsite
ftp_username
ftp_password
lcd "C:\"
cd ftp_folder
get
importedfile
bye

Run Import.bat to fetch importedfile to C: from ftpsite

No comments:

Post a Comment