Reputation: 4560
Here i'm using batch file to take backups & then zip those backups.Backup process successfully.But zipping process failed and it always show to install the 7zip.But i already installed 7ip.
Here goes my code
@ECHO OFF
osql -S .\sqlexpress -E -i "C:\Sql_Backup.sql" -o "E:\test\testbk.sql"
ECHO.
7za a -tzip "E:\test\newfile.zip" "E:\test\newfile.Bak"
ECHO.
del "E:\test\newfile.Bak"
exit
Upvotes: 2
Views: 1210
Reputation: 8292
May be system couldn't find where your 7z.exe is, so just tell your system where your compressing program is by giving the correct path like below:
C:\Program Files\7-Zip\7z.exe a -tzip "E:\test\newfile.zip" "E:\test\newfile.Bak"
Upvotes: 1
Reputation: 9453
What does "it always show to install 7zip" mean? Are you seeing an actual error message? Is the error message this?
'7za' is not recognized as an internal or external command,
operable program or batch file.
If so, that's because the program is 7z
, not 7za
. Just change it in your batch file and see if it starts working...
Upvotes: 2