How to use compact.exe to free up disk space on Windows

How to use compact.exe to free up disk space on Windows

Microsoft introduced new options for the Compact.exe command line tool in Windows 10. It allows users to compress folders on the system using new algorithms to free up disk space.

Unlike many other compression solutions, the built-in promises to have little impact on performance when the system needs to load files. The files are compressed without changing the file extension or location. Decompression occurs during runtime, and most modern systems shouldn’t break a sweat when doing so. The tool is included in Windows 11 as well.

Compact.exe compresses files and folders on Windows without changing the file names or making other modifications to the files. Depending on the type of files, compression may save gigabytes of disk space or very little. Already compressed files, for example, JPG image files, will show little gain when compression is turned on. On the other hand, uncompressed files may show significant gains. You can check this out GitHub pagewhich lists hundreds of games and programs, and the savings when Compress.exe is used on them.

Some apps and games may react poorly to stress. If this is the case, then decompressing will fix the problem.

advice: If you prefer a graphical user interface, check out CompactGUI. Windows includes an option to compress the entire drive. Right-click on any drive in the explorer and select Properties to open the option. You can find “Compress this drive to save disk space” under General in the properties window.

Using Compact.exe on Windows

You can run the program from any command prompt window. Open a new Command Prompt window, for example, using Windows-R to open the Run box, type cmd.exe and hit the Enter key on your keyboard.

Run Zip on its own Displays the compressed status of all folders and files of the current directory.

The command line tool supports several parameters, some of which can be confusing at first.

The basic commands Compact.exe /c and compact.exe /u define current or selected directories so that future changes to the folder will be compressed or decompressed, for example, modified files or newly added files.

It is necessary to provide the /s parameter for the command to perform the specified operation on all files in the specified directory and all of its subdirectories.

By default, the current directory is used, but a directory may be provided to perform the operation on a different directory instead. To do this, add the path information to the command.

The Compact.exe /c /s:c:\users\test\downloads\ command runs the compression on the downloads directory.

You can specify the compression algorithm by providing the /EXE parameter. The parameter /EXE:XPRESS8K uses that algorithm. The following algorithms are supported:

  • XPRESS4K (the fastest and default value)
  • LZX (most compact)

The default algorithm is designed to keep performance impact to a minimum, even on older systems. Most devices should have no problems using the 8K or even 16K algorithm instead.

Other useful parameters of compact.exe:

  • /f Forces compression or decompression. Compressed or uncompressed files are already skipped. It should be used if the process is interrupted, for example, due to a crash.
  • /i ignores errors and continues the process without stopping.
  • /? Displays help information.

closing words

Large program and game folders, and folders with large, uncompressed files, benefit most from compression. Gigabytes of disk space can be recovered with the help of the command. Most Windows users might use CompactGUI instead, as it is easier to use and work with.

Now you: Have you used a zip file in the past?


How to use Compact.exe to free up disk space on Windows

Article name

How to use Compact.exe to free up disk space on Windows


Learn how to free up gigabytes of disk space on Windows devices with the help of the original built-in command line tool.


Martin Brinkmann


gax technology news



Leave a Comment

Your email address will not be published.