View Single Post
Old 05-20-2009, 02:26 AM   #8 (permalink)
TheOutcaste
TSF Enthusiast
 
TheOutcaste's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 815
OS: MS-Dos 6.22 - Win7


Re: Batch Script to FTP

Would probably be better to copy them after uploading rather than trying to do it at the same time. You could start a 2nd batch file to do the archiving just before the FTP starts, but depending on the setup, you might not be able to copy a file that is currently being uploaded.
I'd expect the LAN to be faster than an FTP Upload, but that might not be the case, so you'd need which ever script is NOT going to do the deleting to create a flag file when it is done, and the other script would have to check for that file before deleting.
Easiest to just add the two red lines shown below. type xcopy /? for a list of switches to see if you need to add any others. You could also use Move instead of Xcopy, then you wouldn't need the Delete.
Code:
ftp -v -i -s:"%_tmpfld%\ftpcmds.}t{"
:: Delete the script
Del "%_tmpfld%\ftpcmds.}t{"
Xcopy /CIQ "%_lcd%\*.xml" C:\Myfiles\Archive
Del /F /Q "%_lcd%\*.xml"
EndLocal
HTH

Jerry
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers; I just don't always match the answers to the right questions.
Rated R for Violence -- When your PC flies through a window, that's violent, right?
TheOutcaste is offline   Reply With Quote