Link to home
Create AccountLog in
Avatar of crompnk
crompnkFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Run batch file to zip file using WinRAR

Hi, I have a bat file that runs the following batch script. It works in that it will delete the ZipFile.rar if it exists and then creates a new rar file.

The problem is that the script is adding the folder and .bak file to the ZipFile.rar, how can I specify to ignore the folders and just zip up the .bak file.

I need to run the batch command from another folder (not in C:\Temp\Backup)

Thank you

if exist "C:\Temp\Backup\ZipFile.rar" del "C:\Temp\Backup\ZipFile.rar"
"C:\Program Files\WinRAR\rar.exe" a "C:\Temp\Backup\ZipFile.rar" "C:\Temp\Backup\SQLDb.bak"  -ms

Open in new window

Avatar of oBdA

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account