Disk Cleanup WinSxS folder in Windows Server 2012 (R2) using DISM
Submitted by Dave Blair on Mon, 07/31/2017 - 13:52Here is how to clean up the WinSxs folder on Windows Server 2012 R2, to reclaim disk space.
This will delete superseded updates and unused system files to free up extra disk space.
It uses dism.exe‘s disk cleanup options.
Often the Windows component store folder(C:\Windows\WinSxS) will take up a lot of space on your servers. This folder contains all the files that are required for a Windows installation as well as any updates to those files are also held within the component store as the updates are installed
Here's how to use the DISM tool to safely free up space:
The basic command we use it: Dism.exe /online /Cleanup-Image. This has the following extra options:
/AnalyzeComponentStore
/StartComponentCleanup
/ResetBase with /StartComponentCleanup
/SPSuperseded
Open a PowerShell as Administrator, then: