Our thinking


Clean up Windows 10 WinSxS Folder to free up disk space

Windows 10 (and Windows Server) has a feature where it keeps older versions of shared libraries and other things like that in a Windows Side-by-Side folder (SxS). Over time this folder grows and can end up taking up a fair amount of disk space, especially on servers that may have a huge amount of RAID storage but a small SSD boot drive.

Initially, you can clean some things up with Disk Cleanup, however this won’t touch much stuff in the SxS folder.

As if it were a swarm of angry bees, avoid going in and cleaning up this folder manually. Doing so can lead to Windows not booting, or being completely unable to install any further updates.

Fortunately, Microsoft have some guidelines on how to reduce the size of the folder, and the consequences of doing so: Clean Up the WinSxS Folder

There is a scheduled ComponentCleanup task that runs regularly on Windows that will clean up some items in this folder older than 30 days, however you can kick this off manually and not have the 30 day retention period:

From an elevated CMD prompt, run:

Dism.exe /online /Cleanup-Image /StartComponentCleanup

This will run the task manually and previous versions of updated components will be immediately deleted (without a 30 day grace period) and you will not have a 1-hour timeout limitation on the task running.

To go one step further, you can next use the /ResetBase switch with the /StartComponentCleanup parameter of DISM. This removes all superseded versions of every component in the component store.

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

Be aware that after running this, you will be unable to uninstall any installed Service Packs or Windows Updates, however it will not block the installation of future updates.

Finally, you can reduce the amount of space used by a Service Pack by using the /SPSuperseded parameter of DISM to remove any backup components needed for uninstallation of the service pack.

Dism.exe /online /Cleanup-Image /SPSuperseded

Leave a Reply