If you’ve ever scanned your C drive to find files or folders that occupy a lot of space, you must have seen a surprisingly large folder named “WinSxS”. It’s an enticing target to clean up if you are low on storage – but don’t! Not until you learn what it is and how to clean it the right way in this guide.
What is the WinSxS Folder in Windows and Why It’s Taking So Much Space
Typically, the WinSxS folder hosts all the component store files and will take anywhere from 8GB to 12GB of space within the C drive. The Windows component store contains all the files related to updating Windows and system apps/services. It ensures you always have a backup of critical system data for recovery and stability.
When necessary, these component store files are used to perform actions like recovering your system on boot failure or corruption, rolling back drivers and Windows updates, adding roles for the server manager, running programs using side-by-side assemblies, etc.
Below are some common types of data that are stored here for system stability:
- Windows updates installation files to rollback later. This also includes version upgrades, so you may go back to Windows 10 after upgrading.
- Previous versions of drivers to roll back if things go wrong.
- Copies of essential Windows system files to fix corrupted files, like when you run the SFC/Scannow command.
- .NET Framework (all its installed versions) update files are stored here.
- Additional language packs save their components here, like handwriting recognition engines, font components, voices, etc.
- Optional features like legacy Windows apps or virtualization features (Hyper-V and WSL) add files to the WinSxS folder when activated.
As you use your PC, more and more data is accumulated in the WinSxS folder, increasing its size. However, the data in it becomes obsolete over time as new updates arrive. While Windows does basic cleaning of this folder from time to time, it often fails on an active system. This is why you should clean it from time to time to free up space.
View the WinSxS Folder Real Size in Windows
Before we clean, it’s important to know the correct WinSxS folder size to see if it needs cleaning or not. You might be thinking, what’s so hard about finding the size of the WinSxS folder? After all, you can go to “C:\Windows”, right-click on the WinSxS folder, and select Properties to see the folder size.
But the thing is, that’s not the real size.
In the component store, many files use a technique called Hard Linking. This hard-linking feature allows multiple files to access the same location without creating copies of that location or data. Due to this, when you try to gauge the size of the WinSxS folder using a traditional method, it will think there are multiple copies of the same file taking up space and will reflect that difference in the final size.
To find the actual size of the component store, you need to use the Deployment Image Servicing and Management (DISM) tool via PowerShell.
Type “powershell” in Windows Search, right-click on Windows PowerShell, and select Run as administrator.
In PowerShell, run the following command:
dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
As soon as you execute the command, Windows will scan the component store and create a breakdown of how the space is being used. The one we are looking for is the Actual Size of the Component Store. In my case, the actual size of the component store is 9.98GB. Windows will also tell you whether component store cleanup is recommended or not.
Cleaning Up the WinSxS Folder in Windows
If Windows recommends cleaning the component store, you can do so with another command. If not, it means Windows has already done it, and you don’t have to do anything (unless you want a full reset).
Open PowerShell with admin rights once again, and execute the following command to clean up the WinSxS folder:
dism.exe /online /Cleanup-Image /StartComponentCleanup
The above action will start the cleanup process. It can take some time to clean the component store. Once done, close the PowerShell window and restart your system. In my case, it cleaned up around 3.3 GB.
There is also another, more “nuclear” cleanup command for cleaning the WinSxS folder. It will fully delete all update components and store the current system files’ as backup files. While it will greatly decrease the WinSxS folder size, it will also remove your ability to rollback system changes, run recovery tools, and fix system corruption if anything goes wrong in your current setup.
If you want to fully reset the WinSxS folder in Windows, run the following command in PowerShell:
Dism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase
You should check the size of the WinSxS folder every few months; Windows usually fails to clean it automatically, as the requirements to run the cleanup task are strict. If you are cleaning the WinSxS folder because you are low on storage, make sure you check out methods to free up space in the C drive or get more space without deleting anything.