You can use Disk Cleanup in Windows to clean up the WinSxS folder. You can also use this utility to clean up other Windows folders. You can open it from the search box or by typing cleanmgr.exe into the Windows command window. First, the system will ask you to select the drive you want to clean up. Next, you’ll be prompted to select the file types you want to delete. These include:
- Downloaded program files
- Temporary Internet files
- Delivery optimization files
- Temporary files
You can also see the amount of disk space that you’ll be able to free up. After selecting the file categories, click the OK button to confirm that you want to delete the files. The cleanup will run automatically.
You can find further options under “Clean up system files.” However, you need administrator-level privileges to access these options. The program will then restart and ask you to select the drive you want to clean up. Next, a window appears with options for additional file types to delete:
- Windows Update Cleanup
- Windows Defender Antivirus
- Windows upgrade log files
- Device driver packages
The command-line tool dism.exe is a practical alternative to clean up the WinSxS folder. To use it, you have to run the Command Prompt program (cmd.exe) as an administrator. The command Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore analyzes the WinSxS folder to determine how much disk space the folder is actually using. The output of the command provides useful information, such as the date of the last cleanup, and lists the components the disk space is being used for. The tool also allows you to clean up the WinSxS folder: Dism.exe /Online /Cleanup-Image /StartComponentCleanup
Further useful features of the program include:
- Dism.exe /Online /Cleanup-Image /ScanHealth for scanning the WinSxS folder
- Dism.exe /Online /Cleanup-Image /RestoreHealth for repairing any errors that were detected.
You can also use compression to reduce the size of the WinSxS folder, just as you would with any other folder. First, open the properties of the folder from the context menu and choose the “Advanced” option. Then, place a checkmark next to “Compress contents to save disk space.”