With the time and new patches installed to Windows installations, the Windows WinSxS folder present since W7, W2008, W8 and in W8.1 gets more and more “fat” and takes valuable space. I've previously reported on easy way to shrink that winsxs folder in Windows 7 by installing a patch which adds a new function to the default Windows cleaning wizard and allows to select Windows unused patches left behind taking valuable space. The details can be found in this post. Today I'll show 3 Ways To Shrink WinSXS Folder.
Some of the commands works in W8.1 but not W8.0. Same for 2012R2 (W2012). Let's start with the easy way by going through the cleaning assistant (is also present if you add “Desktop Experience” feature on 2008R2 and W2012, W2012R2) then through one tweak and finish with some CLI commands.
01. The Disk Cleanup Wizard
Well, if you're running W 7 SP1 (or W8.x) with the patch I talked in my previous post, then it's no brainer. It's an effective way to select the unnecessary patches and clean all bunch of other stuff from within the guest OS. It's also useful to do that just before you Image the system or just before you transform the VM into the template.
The wizard's screen:
An update for 2008R2 systems listed in KB article KB2852386, allows using the same wizard in 2008R2, but you need to add “Desktop experience” feature. You can download the update for Windows 2008 R2 from here.
On a Windows Server 2012 R2 the same punition – after you install Desktop Experience feature only.
Note that there is also another method which avoids installing the desktop experience feature to your windows system, but it's unsupported by Microsoft. It consists of copying in the appropriate Disk Cleanup/CleanMgr files into the appropriate location can be done, but at your own risk.
02. Some ClI commands with DISM.exe
First, determine the size of the component store (winsxs) on Windows Server 2012 R2:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
Running this command analyzes the component store to shows the size and gives an advice if cleanup is recommended.
If yes, then execute this command:
Dism.exe /online /Cleanup-Image /StartComponentCleanup
What it does? It removes previous versions of the files updated by Windows Updates.
03.Use the “ResetBase” parameter of Dism.exe
Using the /ResetBase switch with the /StartComponentCleanup parameter of DISM.exe on a running version of Windows 8.1 removes all superseded versions of every component in the component store.
From an elevated command prompt, type the following:
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
But this will makes impossible to uninstall any existing updates and service packs! (so caution). Make sure that you don't need to uninstall any patches past this point… This command works on W8.1 and W2012R2 only.
You can see only slight improvements on my laptop as I executed this command already in the past….
If you have previously installed a Service Pack to your system, then you can use another command which cleans up the backup files created before installing this SP.
dism /online /cleanup-image /SPSuperseded
Additional ways of cleaning the default C: drive in general:
- Move the paging file to another volume on the system.
- Disable hibernation on the system (saves some Gb of space depending on how much RAM the system has).
- Use the dedicated dump file option to capture memory dump files on another volume on the system.
- Offload user profile and program file directories to another volume on the system.
- Delete all but last restore point OR, completely disable system restore points.
You can also uninstall some software > add an additional hard drive > format and add a drive letter > reinstall the software on that drive.
The problem with “fat” WinSxS folder is that especially on systems with 1st or 2nd generation SSD drives which provided less capacity than today's modern SSDs which offers at least 256Gb. So getting some space back is always good -:). Hope it helps.
Paul says
windows 7 winsxs will not clear.
Have KB for cleanmgr installed (removed and reinstalled it as well)
cleanmgr shows 409 MB from updates applied today, but the size of the winSXS folder is 11.5 G!
This is a VM but wanted to know if you had any thoughts on getting this cleaned up.
junaid says
i need to reduce the winsxs folder size but window update cleanup option is not show in disk cleanup utility i also installed required feature and window is also update kindly advice how to reduce the winsxs folder