Reduce the size of your Windows 10 installation using compact.exe

In Windows 10, Microsoft made some changes to the operating system to make it use less disk space. This was essential to compete with Android because Windows tablets with storage as small as 32 GB are being sold today and the experience on them is not optimal if the disk space starts to fill up. These changes should allow a bit more free space on mobile devices like phones and tablets, which are far more limited in disk resources than traditional laptops and desktops. In this article, we will see how to manage your Windows 10 installation and make it use less disk space using the optimizations Microsoft added.

hard drive disk iconTo reduce the total disk footprint, Windows 10 features a new option in the compact.exe built-in command line tool. You may or may not be aware that Windows 8.1 shipped with a feature called WIMBoot to reduce the disk space taken by the OS. Unfortunately, Microsoft ran into servicing issues with WIMBoot so they adopted a different approach with Windows 10. With Windows 10, the compact OS setup does not require any special images or additional partitions like WIMBoot did. It doesn’t use a WIM file, and the compressed files are stored on the regular disk volume. So there are no special steps needed to configure a machine. You just need to specify that this should be enabled.

For an already installed Windows 10 copy, run the following command from an elevated command line instance:

COMPACT.EXE /CompactOS:always

When you run this command, Windows 10 will compress its files. You can free up at least 1 to 1.5 GB of disk space with this. It can be disabled with the following command:

COMPACT.EXE /CompactOS:never

You can deploy Windows 10 using file compression enabled (compact OS) as follows:

  1. Format and partition the disk as required.
  2. Apply the OS image to an NTFS partition using DISM:
    DISM.EXE /Apply-Image /ImageFile:INSTALL.WIM /Index:1 /ApplyDir:C:\ /Compact:ON
  3. Run BCDBOOT C:\WINDOWS to set up the OS to boot.
  4. Reboot.

More details can be found HERE.

You can of course use many other optimizations to reduce the total amount of disk space taken by Windows 10:

That's it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.