Microsoft has hardly coded Windows 10 with the optimization techniques they’ve achieved since days of Windows XP. Along with many new features, there are some useful and handy additions as well in the algorithm of this operating system (OS). Compact command line tool is one of those inclusions which helps you to compress the whole OS installation. As longs as you’re on New Technology File System (NTFS) file system, Compact gives you good zipping results with typically compression ratio 1.5~1.8 to 1.
Windows 10 System Compression Using CompactOS
CompactOS is basically a command line switch which can be executed with Compact command line tool. The general syntax for Compact is as follows:
The parameters can be varied for their corresponding usage:
|/C||Compresses the specified files.|
|/U||Uncompresses the specified files. Directories will be marked so that files added afterward will not be compressed.
|/S||Performs the specified operation on files in the given
directory and all subdirectories. Default “dir” is the current directory.
|/A||Displays files with the hidden or system attributes. These files are omitted by default.
|/I||Continues performing the specified operation even after errors have occurred. By default, Compact stops when an error is encountered.
|/F||Forces the compress operation on all specified files, even
those which are already compressed. Already compressed files are skipped by default.
|/Q||Reports only the most essential information.
|/EXE||Use compression optimized for executable files which are read frequently and not modified. Supported algorithms are:
|/CompactOs||Set or query the system’s compression state. Supported options are:
|filename||Specifies a pattern, file or directory.
As you can observe that /CompactOS parameter is of our interest here as it directly compress OS installation. Here is illustration of this:
How To Compress Windows 10 OS Installation
1. Open administrative or elevated Command Prompt.
2. Type following command and hit Enter key:
This will detect the current compactness state. For default condition, you may get typical The system is not in the Compact state because Windows has determined that, it is not beneficial for this system message which clearly shows that system is not compressed. Then run following command:
So now your system installation is compressed and you can verify it in File Explorer. To un-compress the installation later, you’ve to run this command:
Hope you find the command useful!