search
HomeCommon ProblemHow to use compact.exe to free up disk space on Windows

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

Unlike many other compression solutions, compact promises little impact on performance when the system needs to load files. Files are compressed without changing the file extension or location. Decompression happens at runtime and most modern systems shouldn't bother with this. This tool is also included in Windows 11.

Compact.exe compresses files and folders on Windows without changing file names or making other modifications to the files. Depending on the type of file, compression may save gigabytes of disk space or very little. Files that are already compressed (such as JPG image files) will show little to no gain when compression is run on them. On the other hand, uncompressed files may show significant gains. You can check out this GitHub page which lists hundreds of games and programs and the savings when using compress.exe on them.

Some applications and games may react adversely to compression. If this is the case, unzipping will solve the problem.

Tip: 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 Explorer and select Properties to turn on the option. You can find "Compress this drive to save disk space" under General in the Properties window.

Using compact.exe on Windows

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

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

Running compact alone will display the compression status of all folders and files in the current directory.

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

Core commands compact.exe /c and compact.exe /u mark the current or specified directory so that future changes to the folder (such as modified files or newly added files) will be compressed or decompressed.

The /s parameter needs to be provided to the command to perform the selected operation on all files in the specified directory and all its subdirectories.

By default, the current directory is used, but one can be provided instead of performing operations on a different directory. To do this, add the path information to the command.

Command compact.exe /c /s:c:\users\test\downloads\ Run compression on the download directory.

You can specify the compression algorithm by supplying the /EXE parameter. Parameter /EXE:XPRESS8K uses this algorithm. The following algorithms are supported:

  • XPRESS4K (fastest and default)
  • XPRESS8K
  • XPRESS16K
  • LZX (most compact)

The default algorithm is designed to have as little performance impact as possible, even on older systems. Most devices should have no problem using 8k or even 16k algorithms.

Other useful parameters for compact.exe:

  • /f Forces compression or decompression. Compressed or uncompressed files will be skipped. Should be used if the process is interrupted (for example, crashes).
  • /i Ignore the error and continue without stopping.
  • /? Display help information.

The above is the detailed content of How to use compact.exe to free up disk space on Windows. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:云东方. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment