Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any command line utility in Windows Server 2012 that will reduce the size of C:\Windows\WinSXS. On one of my main production systems that has Hyper-V and Remote Desktop Services, this folder and stuff beneath it is 30+ gigs.

Update That "It's 30 gigs I must fix this" urge was reduced when I realized that Windows reports the size of the folder as if it didn't use hard links, when in fact it does, so actually, it's not really as big as we might have thought. See the links in the comments below.

share|improve this question
The first link in your comment mentions COMPCLN.EXE which is very helpful to know about. Hope that helps someone else. – Warren P Jul 23 '13 at 13:58
up vote 1 down vote accepted

Uninstall unused features by running in admin mode :

Get-WindowsFeature | where-object{$_.Installed -eq 0 -and $_.InstallState -eq 'Available'} | uninstall-windowsfeature -remove

Free space in WinSxS using (some may not work depending on windows version):

dism.exe /online /Cleanup-Image /AnalyzeComponentStore
dism.exe /online /Cleanup-Image /StartComponentCleanup
dism.exe /online /Cleanup-Image /SPSuperseded
share|improve this answer
I'm going to test that first command on a VM before I try it in production. It looks okay though. – Warren P Mar 21 at 17:21

Uninstall-WindowsFeature $FeatureYouDontWant -Remove is probably the best supported thing you can do to reduce Component Store size.

There are some tools that claim to be able to shrink WinSxS, but it's so easy to break your Windows installation by fiddling around in there, none of them are recommended.

share|improve this answer
And it turns out that the SxS store uses hard links and isn't really quite as big as Windows itself reports. – Warren P Jul 23 '13 at 14:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.