Share via


Schedule file compression

Question

Saturday, August 26, 2017 5:37 PM

I am trying to determine if it is possible to schedule the compression of the files in a specified folder in Windows 10.

If this is possible, how would I go about creating the steps to make this happen on a regular schedule, like once per day?

I know I can use the Task Scheduler to set up the schedule for the process, but am unsure how to create the program to tell the computer exactly what I want.

An example of what I would like to is to compress all of the files and folders under the "C:\data" folder into a compressed file called "DataBackup20170825", with the date for the specific backup automatically added at the end. I want that to run every day at a specified time, placing the compressed file in a specified folder, say "c:\backups".

Any help would be greatly appreciated.

All replies (5)

Wednesday, August 30, 2017 1:01 PM âś…Answered

Afaik the 7za.exe is command line version, that is part of the '7-Zip Extra: standalone console version, 7z DLL, Plugin for Far Manager' (that is 7 Zipped so would need 7 Zip to extract it).

Not had need to use it myself but looking appears to quite a lot online regarding 7 Zip command line.


Saturday, August 26, 2017 7:29 PM

You could write a PowerShell script and use the Compress-Archive to compress the file then delete the original (Compress-Archive does have a 2 GB.

Beyond the 7-Zip has command line programs so could use that to write a batch file to do it.


Monday, August 28, 2017 2:27 AM

You could write a PowerShell script and use the Compress-Archive to compress the file then delete the original (Compress-Archive does have a 2 GB.

Beyond the 7-Zip has command line programs so could use that to write a batch file to do it.

The PowerShell script, did you mean it has a 2 GB limit for a compressed file size, or any file to be compressed must be less than 2 GB, or something else?


Monday, August 28, 2017 4:56 PM

So any file to be compressed has to be smaller than 2 GB, the resulting .zip can be bigger than 2 GB based on multiple files.


Wednesday, August 30, 2017 11:08 AM

So any file to be compressed has to be smaller than 2 GB, the resulting .zip can be bigger than 2 GB based on multiple files.

Thanks! That means powershell is not an option. One file is a database, proprietary, that is already about 5 GB.

I guess I will have to learn  more about 7-zip.