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
Best Answer
I am not sure on how the
%0
works but doing on the follow way it works just fine for me:Where ftp_data.txt has the follow content: