Compress Windows System Files with CompactOS

Use compact /compactos to enable built-in OS file compression — a forgotten way to free several GB on small SSDs.

Windowsoptimizationcmddisk-spaceMedium risk
Run compact /compactos:query to check status, then compact /compactos:always in an elevated prompt to compress system binaries and reclaim roughly 2 GB.

01Command

Command
$ compact /compactos:query
compact /compactos:always

02What it does

CompactOS compresses Windows system files and installed binaries with XPRESS/LZX transparent compression, unlike NTFS folder compression which targets user files. Windows often enables it automatically on drives under 32 GB, but it is safe and useful on larger drives too. Query first, then enable or disable with /always and /never; the recompression pass takes 10-20 minutes but requires no reboot.

03Risk

RiskMedium risk
RequirementsRun in an elevated prompt
!Warning: On very fast, roomy SSDs the CPU overhead of transparent decompression can slightly slow large file reads; disable with /compactos:never if benchmarks regress.

04Undo

Undo
$ compact /compactos:never

05Sources

  • compact - SS64
    SS64 · technical · 2026-09-17
    Evidence: Reference for compact.exe including CompactOS mode and per-file compression options.
  • compact
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents the /compactos:query|always|never switches for OS-level compression.

Last verified: 2026-09-17 · Category: System & Settings

06Related solutions