WinSxS folder haunts users since Windows Vista. Indeed, if you go to Windows folder on the system drive and look at the size of the WinSxS folder, you will be greatly surprized. What is stored in this folder, why is it so big and how to reduce its size? Let’s find it out.
[tab title=”Contents of this article”]
First of all, I’ll remind you what the WinSxS folder is. All more or less modern Microsoft operating systems (starting from Windows Vista) consist of components. A component in Windows contains of one or more binary files, a directory file and an XML file with the description of settings (registry keys, safety settings, etc.). The components are grouped into logical blocks that form different Windows versions.
All OS components are stored in the WinSxS folder, which is a storage for these components. Each component in the storage has a unique name indicating the number of version, local language and the CPU architecture for which it was assembled. The operating system has only one instance of each version of every file and this instance is located in the WinSxS folder; all other instances are the hard links to files kept in the storage.
Actually, the WinSxS folder contains almost all the operating system including the components that are not installed. By the way, this is why the system doesn’t need the installation disk when installing additional components.
The WinSxS folder is initially large and with time it becomes even larger. It takes place due to the update of the components. Since not a file, but a component is the update unit in Windows, while updating a single binary file, a new version of the component is issued. The new version is installed in the system, but the earlier version is not removed, it is left in the storage instead. This approach allows to cancel an update and roll back to the previous version of the component at any time.
Thus, the size of the WinSxS folder directly depends on the age of the system and a number of installed updates: the older the system is, the bigger its size is. Although, the things are not that bad and in fact the average size of this folder does not exceed 10-15GB. Besides, we remember that the majority of the system files from the Windows folder are mapped into it from the WinSxS folder using hard links, so the size of WinSxS is far less.
Due to hard links, some file managers can show a bit exaggerated size of the WinSxS folder. You can get more accurate information on the size of a folder in Windows 8 with the tool Disk Usage by Sysinternals. You just have to uncompress the it and run the following command:
As you can see, it shows a bit smaller size of the folder than the Windows Explorer.
If you lack space on your system disk, the storage size can be reduced by deleting the components that are not used. Notice, that you can’t just delete redundant files, because it can lead to complete nonoperability of the system. Windows 8 has three ways to safely clean the WinSxS folder.
Windows 8 Disk Cleanup Tool
To clean up the storage, you can use a graphic tool Disk Cleanup run with administrator privileges. To do it, go to C:\Windows\System32, find cleanmgr.exe and then click Run as Administrator.
To reduce the size of the WinSxS folder, you have to check Windows Update Cleanup and click OK. By the way, this tool doesn’t determine the size of cleaned up space very accurately. In fact, it can be about 300MB less.
You can also clean the storage of components with the console tool DISM. To do it, run the following command from the command line with the administrator rights:
Dism /Online /Cleanup-Image /StartComponentCleanup
Using DISM, you can clean up the storage after installation of the service pack (SP):
Dism /Online /Cleanup-Image /SPSuperseded /HideSP
The key /SPSuperseded deletes archive files created during the SP installation and /HideSP removes it from the list of the installed updates. But since Windows 8.1 was issued instead of the service pack to Windows 8, you are not able to use these keys yet. Actually, this method can be used in Windows 7 with SP1.
Cleanup task in Task Scheduler
Section Microsoft\Windows\Servicing of the Task Scheduler library contains the task StartComponentCleanup. This task is launched automatically by the system as a part of automatic system maintenance, but if necessary it can be run manually. The effect from running this task is almost the same as the previous means demonstrate but for the recent updates (last 30 days) that are ignored.
New cleanup options in Windows 8.1
Some new parameters for storage cleanup in DISM appeared in Windows 8.1. Now we can see the exact storage size and analyze its contents using the command:
Dism /Online /Cleanup-Image /AnalyzeComponentStore
The most interesting is that it has become possible not only to clean up the storage, but also to delete all previous versions of the components:
Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase
The key /ResetBase is not used in scheduled cleanup and cleanup from the graphic snap-in. It can help to free some more disk space, but beware. After you have deleted the previous versions, you can’t delete the installed updates and in case of any issues rolling the changes back becomes impossible.
Simply a single command or a couple of clicks can clean up some extra gigabytes on your disk. Actually, today the size of hard disks allow to forget about the lack of space and the SSD of 256GB are quite affordable. So, in my opinion, the issue of WinSxS size matters only for Windows 8 tablet owners.