WinSxs Folder Cleanup

Windows 8.1 introduced a new command line option for DISM.exe, /AnalyzeComponentStore. Running this command, will analyze the WinSxS folder and tell you whether a Component Store Cleanup is recommended or not.

In Windows 8, open Disk Cleanup Tool and use the Windows Update Cleanup option to clean the WinSxs.

Microsoft released an Update that added the Windows Update Cleanup option to Disk Cleanup tool in Windows 7.

You can now also clean up WinSxS in Windows Server 2008 R2 with new the new Update.

Here are some other options you may consider to free up disk space – some routine and some extreme:

  1. Run Disk Cleanup tool or CCleaner
  2. Uninstall unused applications
  3. Move Page file to another drive
  4. Disable hibernation
  5. Use the dedicated dump file option to capture memory dump files on another volume on the system.
  6. Disable system restore points
  7. Offload user profile and program file directories to another volume on the system.

Update 1 From TechNet Blogs : One of the largest changes between previous versions of Windows and Windows 7 / Vista was a move from an INF described OS to componentization. All of the components in the operating system are found in the WinSxS folder – in fact we call this location the component store. Each component has a unique name that includes the version, language, and processor architecture that it was built for. The WinSxS folder is the only location that the component is found on the system, all other instances of the files that you see on the system are “projected” by hard linking from the component store.

Now that you know why the store can grow to be so large, your next question is probably to ask why we don’t remove the older versions of the components. The short answer to that is reliability. The component store, along with other information on the system, allows us to determine at any given time what the best version of a component to project is. That means that if you uninstall a security update we can install the next highest version on the system – we no longer have an “out of order uninstall” problem. It also means that if you decide to install an optional feature, we don’t just choose the RTM version of the component, we’ll look to see what the highest available version on the system is.

The only way to safely reduce the size of the WinSxS folder is to reduce the set of possible actions that the system can take – the easiest way to do that is to remove the packages that installed the components in the first place. This can be done by uninstalling superseded versions of packages that are on your system. Service Pack 1 contains a binary called VSP1CLN.EXE, a tool that will make the Service Pack package permanent (not removable) on your system, and remove the RTM versions of all superseded components. This can only be done because by making the Service Pack permanent we can guarantee that we won’t ever need the RTM versions.

Update 2 From E7 Blogs : “Modularizing” the operating system was an engineering goal in Windows Vista. This was to solve a number of issues in legacy Windows related to installation, servicing and reliability. The Windows SxS directory represents the “installation and servicing state” of all system components. But in reality it doesn’t actually consume as much disk space as it appears when using the built-in tools (DIR and Explorer) to measure disk space used. The fact that we make it tricky for you to know how much space is actually consumed in a directory is definitely a fair point! The WinSxS directory also enables offline servicing, and makes Windows Vista and later “safe for imaging”.

There have been several blogs and even some “underground” tools that tell you it’s ok to delete the WinSxS directory, and it’s certainly true that after installation, you can remove it from the system and it will appear that the system boots and runs fine. But as described above, this is a very bad practice, as you’re removing the ability to reliably service, all operating system components and the ability to update or configure optional components on your system. Windows only supports the WinSxS directory on the physical drive in its originally installed location.

Conclusion

Let the WinSxS folder be as it is!

Learn about the Sysnative folder here.

Post ported from WVC.

Additional reads:

  1. Analyze Windows Component Store or WinSxS in Windows 8.1
  2. WinSxS folder cleanup in Windows 8
  3. Add Windows Update Cleanup option to Disk Cleanup tool in Windows 7

 

 

  1. Clean up WinSxS Directory on Windows Server 2008 R2.