What is the WinSxS folder?
WinSxS is a folder inside the Windows folder. Windows keeps copies of system files there. It uses them for updates, repairs and rolling back a bad update. The folder looks very big. Part of that size is only a display effect, because many files are links to other files.
Warning: Never delete files from the WinSxS folder by hand. This can break Windows so that it cannot start or update. Always use the tools below. Take a backup or a snapshot of your server first.
Steps with Disk Cleanup
- Click Start and type Disk Cleanup.
- Open it and pick the drive that holds Windows. This is usually drive C.
- Click Clean up system files. If asked, pick drive C again.
- Tick Windows Update Cleanup.
- Click OK, then confirm with Delete Files.
- Wait until it finishes. This can take some time.
On Windows Server, the Disk Cleanup tool may not be installed. Then use the commands below.
Steps with the command line
The command line is a black window where you type commands. DISM is a Windows tool that repairs and cleans the system image.
- Click Start and type cmd.
- Right-click Command Prompt and choose Run as administrator.
- First, ask Windows how big the store is:
This command shows the size and says if a cleanup is recommended.Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore - If a cleanup is recommended, run:
This command removes old versions of update files that are no longer needed.Dism.exe /Online /Cleanup-Image /StartComponentCleanup - Wait until you see a message that the operation completed.
Warning: Do not add the
/ResetBase option unless you are sure. It makes installed updates impossible to uninstall.Good to know
- The space you gain is often small. Do not expect gigabytes every time.
- Do not stop the command halfway.
- Restart the server after a big cleanup if Windows asks you to.
Quick recap
- WinSxS holds system files that Windows needs. Do not delete them by hand.
- Use Disk Cleanup and choose Windows Update Cleanup.
- Or run the DISM analyze and cleanup commands as administrator.
- Make a backup first.