How to Clear the Windows Component Store (WinSxS) using DISM

The Bloat of the WinSxS Folder

As a Windows Server or Windows 10/11 machine downloads and installs monthly cumulative updates, the operating system does not simply overwrite the old system files. It keeps the previous versions safely archived in the Windows Component Store, a highly protected directory located at C:\Windows\WinSxS (Windows Side-by-Side).

This architecture is brilliant for stability—it allows administrators to cleanly uninstall a corrupted Windows Update and roll the server back to its previous state. However, the downside is severe storage bloat. Over several years, the WinSxS folder can easily balloon to 20GB or 30GB, filled with obsolete update binaries from three years ago that you will never realistically need to roll back to.

Because the Component Store is deeply linked to the active kernel via hard links, you cannot simply open File Explorer and delete the folder. You must use the Deployment Image Servicing and Management (DISM) tool to safely prune the archive.

Step 1: Analyzing the Component Store

Before you run a destructive cleanup, you should ask DISM to analyze the folder to see if a cleanup is actually necessary.

Open an elevated Command Prompt or PowerShell as an Administrator and execute:

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

This command takes a few minutes to run. It will output a detailed report showing the true size of the Component Store (accounting for hard links), how much space is consumed by backups and disabled features, and a final recommendation (e.g., Component Store Cleanup Recommended: Yes).

Step 2: Performing a Standard Cleanup

If a cleanup is recommended, you can trigger the standard pruning operation. This command instructs Windows to safely delete superseded update files (files that have been replaced by newer updates).

Dism.exe /Online /Cleanup-Image /StartComponentCleanup

Warning: This process is heavily CPU and I/O intensive. It can take anywhere from 10 minutes to over an hour, depending on the speed of your hard drive and how many years of updates are stockpiled. Do not interrupt this process.

Once completed, you will no longer be able to uninstall the specific updates that were purged, but your system will remain fully patched with the latest cumulative update.

Step 3: The ResetBase Nuclear Option

The standard cleanup is safe, but it leaves some baseline files intact. If you are desperately low on disk space (e.g., a small 40GB cloud VM), you can append the /ResetBase flag.

Dism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase

This command is highly destructive to your rollback capabilities. It completely resets the baseline of the Component Store to the currently installed updates. It will purge every single superseded component. After running this, it is mathematically impossible to uninstall any currently installed Windows Update. You should only run this if you are 100% confident that the current patch state of the server is perfectly stable.

Step 4: Removing Disabled Features

Finally, the WinSxS folder also stores the binaries for optional Windows features (like Telnet Client or Windows Server Backup) even if they are not actively installed, just in case you ever want to install them.

To purge the binaries for a specific unused feature and reclaim that space, use the Remove flag:

Uninstall-WindowsFeature -Name Telnet-Client -Remove

If an administrator later attempts to install the Telnet Client, Windows will realize the binaries are missing from WinSxS and will be forced to download them fresh from Windows Update.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.