2

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.

Warren P
  • 1,195
  • 7
  • 20
  • 35
  • See also: http://serverfault.com/questions/79485/windows-2008-winsxs-directory-growing-uncontrollably-blocking-server, http://serverfault.com/questions/444031/windows-2008-r2-winsxs-folder-growth-increases, and http://serverfault.com/questions/177657/why-is-the-total-size-of-my-files-on-windows-7-more-than-total-disk-size/177712#177712 – Chris S Jul 02 '13 at 19:17
  • 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

2 Answers2

3

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.

Ryan Ries
  • 55,011
  • 9
  • 138
  • 197
  • 1
    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
2

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
John R
  • 36
  • 1