To reduce size of WinSxS folder on a running version of Windows OS you can run couple commands.
Command line utility (cmd
or powershell
) must be ran as Administrator!
To determine the actual size of the WinSxS folder, use this command:
dism.exe /online /Cleanup-Image /AnalyzeComponentStore
Now we can reduce its size by running this command:
dism.exe /online /Cleanup-Image /StartComponentCleanup
To remove all superseded versions of components in component store, use this command:
dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
To reduce amount of space used by Service Pack, use this command:
dism.exe /online /Cleanup-Image /SPSuperseded
The service pack cannot be uninstalled after this command is completed.
Also you can “compact” running os by running this command:
compact.exe /CompactOS:always