• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Batch file zipping

chuck2002

Senior member
Ok here is what I have:
I have some windows backups that are done nightly and stored.

Here is what I want to do:
I would like to zip each .bak file via a scheduled task that runs each day. I want to do the files separately and dynamically, so for my example I have:
1 folder containing
100005.bak
1000045.bak
100043.zip

And so on. I want it to take each .bak file and compress it to %file_name%.zip, delete the original.bak file and move on to the next .bak file until they are all compressed individually.
I want to be able to schedule this to run daily.
Thank you for any suggestions.
 
First, get 7za.exe. Put it in your PATH.

Next, put the following in a batch file and it should do what you want, if I did it right:
Code:
for %%i in (*.bak) do 7za a -tzip "%%~ni.zip" "%%i" && del /f "%%i"

Test it before using it in production!!!

Finally, add the batch file to Task Scheduler to do it automatically.
 
Back
Top