How to cleanup the winsxs folder on Windows 7 (SP1)/ Windows 2008 / Windows 2008 R2 (SP1)
The winsxs folder in c:\windows can be really big, the only way to cleanup is using the microsoft command line tools :
Windows Server 2003 : VSP1CLEAN.exe
Windows Server 2008 : COMPCLN.exe
Windows 7 and Server 2008 R2 : DISM.exe
I will explain the last one here. Start your command prompt As Administrator.
Usage: dism /online /cleanup-image /spsuperseded
After running this command it won’t be possible to uninstall any service packs!
So almost 3Gb on my Windows 7 Sp1 machine is released.
You can also run these commands :
Takeown /f %windir%\winsxs\ManifestCache\*
Icacls %windir%\winsxs\ManifestCache\* /GRANT administrators:F
Del /q %windir%\winsxs\ManifestCache\*
In my case this cleanup another 500Mb