My site is ad supported.

Convert to 7-Zip Archive (Script)

Version 1.0 - Download (Requirements Included) | Download (Script Only)


Description

Converts a compressed file, such as a zip file into 7-zip (7z) format. This process typically yields a much better compression ratio, hence a smaller file size which is ideal for archiving seldom used files.

Requirements:

  • 7za.exe

Examples

The following command converts the file "Backup.zip" to "Backup.7z" (in the current directory) using maximum compression and deletes the zip file once completed:

To7z Backup.zip /L 9 /D

The following command converts the file C:\Backup.zip to Backup.7z stored on a network location and keeps the source file:

To7z C:\Backup.zip /O \\NetworkPath\Backups\


My site is ad supported.

Help Information (/?)

To7z File [/O Dir] [/L CmpLevel] [/D] [/Q]

 File         Existing archive file to decompress.
 /O Dir       Sets the output directory. Default behavior is to use the same
              directory as the source archive file.
              Important Note: The value of Dir should end with a \ character
              to ensure it is properly detected as a directory.
 /L CmpLevel  Specifies the compression level to use for the 7z archive.
              Default behavior is to use normal compression.
              Valid options are: 1, 3, 5, 7, 9 (default = 5).
              Higher number gives more compression but is slower.
 /D           Delete source file after a successful conversion.
 /Q           Quiet mode. Will not show statistics after conversion.