sodcalculator

10 Tech How-To

Windows Can’t Be Installed: Compressed OS Fix

Guide 10-28068 · Updated · Step by step

The error “Windows cannot be installed because this PC uses a compressed operating system” appears when you try to upgrade or reinstall Windows 10/11 on a system where the current OS drive was compressed with the built-in CompactOS feature (or a third-party tool). The fix is to decompress the OS files before running Setup, using the command compact /compactos:never in an elevated Command Prompt, then retry the installation.

What Causes This Error

Windows 10 and 11 include a feature called CompactOS that compresses system files to save disk space, especially on devices with small SSDs. When enabled, the operating system files on the C: drive are stored in a compressed form, and the system reads them on the fly. This works fine for normal operation, but Windows Setup (the installer) does not support installing over a compressed OS. The setup engine checks for this condition and aborts with the exact error message you see.

Third-party disk compression tools (like some “space saver” utilities) can also trigger the same error because they use similar compression mechanisms. Even if you don’t remember enabling CompactOS, it may have been turned on by a manufacturer or by a previous optimization tool.

How to Check If Your OS Is Compressed

Before attempting a fix, verify that compression is actually the problem. Open a Command Prompt as administrator and run:

compact /query

This shows the compression state of the system drive. If you see a line like “The system is in the Compact state” or a high number of compressed files, then CompactOS is active. If it says “The system is not in the Compact state”, the error may have a different cause (e.g., a corrupted installer or a disk encryption issue).

Step-by-Step Fix: Decompress the OS

  1. Boot into your current Windows installation (the one that is compressed).
  2. Right-click the Start button and select Command Prompt (Admin) or Windows PowerShell (Admin).
  3. Type the following command and press Enter:
    compact /compactos:never
  4. Wait for the process to finish. It may take several minutes and will decompress all system files.
  5. Reboot your PC.
  6. Run Windows Setup again. The error should no longer appear.

If you are upgrading from a USB drive or ISO, make sure you are booted into the existing OS when you run Setup, not booting directly from the installation media (which would perform a clean install and might still fail if the drive is compressed).

What If the Command Doesn’t Work?

In rare cases, the compact /compactos:never command may not fully decompress all files, or the error persists. Try these alternatives:

  • Run compact /u /s to decompress every file on the drive, not just system files. This is more thorough but takes longer.
  • Use Disk Cleanup to remove temporary files and then run dism /online /cleanup-image /restorehealth to repair system files, then retry.
  • Perform a clean install – if you don’t need to keep your files, boot from the installation media, delete all partitions on the drive, and install fresh. This automatically removes any compression.
  • Check for third-party compression – if you used a tool like “CompactGUI” or “WimBoot”, you may need to decompress using that tool’s own option before running Setup.

Why Does Windows Setup Reject a Compressed OS?

Windows Setup needs to modify system files, replace them, and create new ones. When the existing files are compressed, the installer cannot safely overwrite them without risking corruption. The setup engine is designed to work with uncompressed system files to ensure a stable upgrade or repair. It’s a safety measure, not a bug.

Note that this error is different from the “Windows cannot be installed to this disk” error that appears when the disk is GPT vs MBR or has an unsupported partition layout. If you see a different message, check the partition style and disk format.

Preventing the Error in the Future

After you successfully install Windows, you can re-enable CompactOS if you need to save space, but be aware that future feature updates may require you to disable it again. To avoid the hassle:

  • Keep at least 20-25 GB free on your system drive.
  • If you use CompactOS, remember to run compact /compactos:never before any major Windows update or reinstall.
  • Consider using external storage or cloud services instead of compressing the OS drive.

Frequently Asked Questions

Will decompressing my OS delete my files?

No. The compact /compactos:never command only decompresses system files; your personal documents, photos, and programs are not touched. It’s safe to run and does not require a backup, though a backup is always a good idea before any major system change.

How long does decompression take?

It depends on the size of your Windows installation and the speed of your drive. On a typical SSD, it usually takes 5-15 minutes. On a slower HDD, it can take up to an hour. The command shows progress, so you can see it’s working.

Can I install Windows without decompressing?

No, not through the normal Setup process. The only way to install over a compressed OS is to decompress it first, or to perform a clean install by booting from installation media and formatting the drive. There is no supported workaround.

What if I don’t have an admin password?

You need administrator privileges to run the compact command. If you don’t have the password, you may need to reset it using Windows recovery tools, or contact your system administrator. Without admin rights, you cannot fix the error from within Windows.

Does this error affect Windows 11 too?

Yes, Windows 11 also supports CompactOS and will show the same error if you try to install over a compressed system. The fix is identical: run compact /compactos:never before running Setup.

Can I use System Restore to undo the compression?

System Restore does not change the compression state of the OS. It only restores system files and registry settings to a previous point. You must use the compact command to decompress the OS. If you have a system image backup from before compression, you could restore that, but it’s usually simpler to just run the command.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →