I am trying to ZIP and FTP a file in one batch file. The Zip part works, but the FTP application reads the entire batch script, rather than just the lines below the FTP commands, causing errors
If these files are nor read sequentially, how do I Zip and FTP in the same batch file?
@echo off
:: zip the file(s)
7z a -tzip c:\test.zip c:\unst.log
:: ftp the files
C:\WINDOWS\system32\ftp.exe -s:%0
open 10.1.7.10
myusername
mypassword
binary
put c:\test.zip
quit
pause
::exit
ftp_script.txtthat has the FTP commands. – Adrien Aug 6 '10 at 17:18ftp.execommand tries to use the upload commands%0. However,%0in a batchfile means the batchfile itself (or more precise: that path+name under which the batchfile was called). This can not work, since your example batchfile has some non-ftp commands at the beginning (like the@echo,::and the7zcommands)... – pipitas Aug 8 '10 at 1:45