To use this batch, toss it into the folder that contains your archives and fire it up. When started a command prompt will open that displays the current activity. As the script runs, it generates log files within the folder that it was started in. The "Log Files" section will explain what each log documents.
Edit 7z_ccd_start.bat with a text editor and find the Configuration section near the top.
I prefer Notepad++, it gives the syntax highlighting as seen below and you can edit any file in it with a right click.
Here you can change the path to 7-Zip, just make sure to keep the value within quotes.
:: Path to 7-Zip.
SET SevenZipPath="C:\Program Files\7-Zip\7z.exe"
7-Zip Command Line
You can also pass 7-Zip commands. See "7-Zip Commands" section for more info.
:: Enabled 7-Zip commands.
SET SevenZipCommands=-mx=9 -md=32m
Force Keep 7-Zip Archives
You can force the script to only convert files to 7z. When this option is enabled, the script will also report space lost if 7z compression failed to be better.
:: Force script to keep 7z archives. 0-disable / 1-enable
With this option enabled, processed archives will be placed into directories based on: no changes, converted, lost space, or failed.
:: Place archives into directories. 0-disable / 1-enable
Break 2GB Batch Limit
This batch supports recompression of files up to 2 GB in size by default, but can be configured to support files up to 20 GB.
:: Exceed the batch 2GB file limit. 0-disable / 1-enable
Enable this option for files over 2GB or you will get the error: "Invalid number. Numbers are limited to 32-bits of precision." This error will most likely cause the script to halt, close the command prompt window, keep both the 7z and rar/zip version of the file, and not remove the "contents" folder.
BreakBatchLimit may break comparison of small files, and it makes file size calculations slightly more inaccurate. This script internally compares the files in Bytes; the KB and MB values are just for display. This option truncates the last digit in Bytes before comparisons and calculations, so 1-9 bytes are lost in the calculation. To iterate, they are not lost from the file, just the equation. Your files will remain 100% in tact. These lost bytes may be important when comparing very small files so only enable it when you plan on dealing with archives larger than 2 GB.
For example, a 7-zip file of 23451 Bytes and a RAR file of 23459 Bytes will both be seen as 2345 Bytes, and the RAR file will be kept over the 7-zip file.
The main log and command prompt will let you know how much space you recovered if an archive was converted to 7z, and will output the total space recovered in both KB and MB when all operations are complete. This number is how much hard drive space you actually freed up in the conversion.
Along with the amount of space recovered, it will also let you know the total amount of space preserved if 7z failed to have a lower compression ratio. This is not space that was freed up, so you don't gain any hard drive space. This number is how much space you would have lost if converting to 7z.
Starting with v2.00, the script will also let you know if any space was lost if you forced the option to convert only to 7z.
Commands may help to achieve higher compression in 7z files at the cost of compression speed.
Edit 7z_ccd_start.bat with a text editor. In the configuration is:
SET SevenZipCommands=-mx=9 -md=32m
Commands must have spaces between them. You can add any commands here that 7z recognizes. You will notice -mx=9 is already here, which is the setting for "Ultra" compression level. -md=32m is the dictionary size that I have set (due to the fact it is light on RAM and makes a good default).
Dictionary Size (-md=#m):
The command to adjust the dictionary size is -md=#m where # is the value in megabytes. If you have the RAM to spare, then you can try to get better compression by increasing the dictionary size. The higher the value, the more RAM 7-Zip will use when compressing files, but the longer it will take to compress. The examples below will let you know approximately how much RAM that a few common dictionary sizes use.
A solid archive treats all files within an archive as one large file, which can yield better compression but does not allow you to extract a single file from the archive without going through all of its contents when decompressing. A non-solid archive is the opposite in that all files are compressed individually within the archive. This setting has no effect on archives containing a single file.