So I am wanting to make a small batch file that will delete, rename and pack some files using winrar then upload the new file using ftp.
Code: Select all
cd D:\test
del test02.rar
rename test01.rar test02.rar
rar.exe a D:/test/test01.rar c:/test/test/ -hppassword -rr5p -tk -dh -m3
@ftp -i -s:"%~f0"&GOTO:EOF
open ftp.test.com
user
password
binary
mput D:\test\test01.rar
bye
the issue I'm having is that when it runs the @ftp line it starts over and tries to run the "cd D:\test" and the rest of the lines as ftp commands so getting some error messages that the right command isnt being run, it still works but was looking at cleaning it up so it doesn't keep throwing up errors. It is important to me that the batch file stays as a single file so would like to avoid using a txt file to keep the ftp information separate.
thank you and any help would be appreciated.