Windows Guide Β· WinSxS Cleanup

How to Clean the WinSxS Folder in Windows 10 and Windows 11 Safely

A practical guide to reducing the size of C:\Windows\WinSxS without breaking Windows Update, system recovery, or component servicing.

⏱ 7 min read πŸͺŸ Windows 10 πŸͺŸ Windows 11 βœ… Safe built-in tools only

What Is the WinSxS Folder in Windows?

WinSxS stands for Windows Side-by-Side. It is the Windows component store located at C:\Windows\WinSxS. Windows uses this folder to store system components, update files, optional features, language resources, and files required for repairing or servicing the operating system.

The WinSxS folder is not a normal cache folder. It is part of the Windows servicing architecture. Windows Update, optional Windows features, DISM repair operations, and system file recovery can all depend on files stored in this location.

⚠️
Important Do not open C:\Windows\WinSxS and delete files manually. Manual deletion can break Windows Update, DISM, SFC, optional features, and future cumulative updates.

The correct way to clean WinSxS is to use built-in Windows servicing tools: DISM, Task Scheduler, Disk Cleanup, or Storage Sense. These tools remove only superseded components that Windows no longer needs.

Why Is the WinSxS Folder So Large?

WinSxS may look very large in File Explorer, but the reported size is often misleading. The component store uses hard links, which means some files appear to exist in multiple locations while actually sharing the same data on disk. Because of this, File Explorer can overestimate the real amount of space used by WinSxS.

However, WinSxS can still grow over time. The most common reasons are cumulative updates, feature updates, language packs, optional features, and older versions of system components kept temporarily for rollback or servicing.

Reason What It Means Can Cleanup Help?
Windows cumulative updates Old component versions remain after new updates are installed. Yes, DISM can remove superseded components.
Feature updates Windows keeps rollback and servicing files after major upgrades. Yes, after the rollback period or with cleanup tools.
Optional Windows features Components for features such as .NET Framework, Hyper-V, or language packs may be stored. Partly, depending on installed features.
Hard links Explorer may count the same data more than once. No; this is a reporting issue, not wasted space.

Before You Clean WinSxS: Safety Checklist

Cleaning WinSxS is safe when done with built-in tools, but it is still a system-level operation. Before running cleanup commands, use this short checklist.

  1. Install pending Windows updates. Open Settings β†’ Windows Update and restart the PC if Windows asks for it.
  2. Make sure the system is stable. If Windows recently installed a problematic update and you plan to uninstall it, do not use /ResetBase.
  3. Open Command Prompt or Terminal as administrator. Most DISM cleanup commands require elevated permissions.
  4. Keep the computer plugged in. On laptops, connect the charger before starting cleanup.
  5. Create a restore point or backup if the computer contains important data or is used for work.
ℹ️
Best practice Run standard /StartComponentCleanup first. Use /ResetBase only when you understand that it prevents uninstalling already superseded updates.

How to Check the Real WinSxS Size with DISM

Before cleaning anything, check the component store status. The DISM analysis command shows the real component store size, the number of reclaimable packages, and whether cleanup is recommended.

  1. Right-click the Start button.
  2. Select Terminal (Admin), Windows PowerShell (Admin), or Command Prompt (Admin).
  3. Run the command below:
Command Prompt / PowerShellDism.exe /Online /Cleanup-Image /AnalyzeComponentStore

Look for these lines in the output:

βœ…
Safe command /AnalyzeComponentStore does not change the system. It only reports the current state of the Windows component store.

Clean the WinSxS Folder with DISM StartComponentCleanup

The recommended command-line cleanup method is /StartComponentCleanup. It removes superseded component versions that Windows no longer needs, while preserving normal servicing functionality.

Recommended DISM cleanup commandDism.exe /Online /Cleanup-Image /StartComponentCleanup

How to use it:

  1. Open Terminal, PowerShell, or Command Prompt as administrator.
  2. Paste the command above and press Enter.
  3. Wait until DISM reaches 100% and reports that the operation completed successfully.
  4. Restart Windows if prompted, or if cleanup appears incomplete.
  5. Run Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore again to compare the result.
ℹ️
What this does This command performs immediate component cleanup. It is similar to the automatic StartComponentCleanup task, but it is launched manually and is not limited in the same way as the scheduled maintenance task.

This is the best option for most users because it reduces WinSxS size without aggressively locking the current update state.

Use DISM ResetBase to Reduce WinSxS Even More

The /ResetBase option removes all superseded versions of every component in the component store. It can reclaim additional disk space, but it also has an important limitation: after using it, you cannot uninstall the already superseded updates that were cleaned up.

Advanced DISM cleanup commandDism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase
⚠️
Warning Use /ResetBase only on a stable system. If a recent update caused problems and you may need to uninstall it, do not run this command yet.

Recommended use cases for /ResetBase:

For everyday home PCs, standard /StartComponentCleanup is usually enough. Use /ResetBase as an optional advanced step, not as the first cleanup attempt.

Run the StartComponentCleanup Task in Task Scheduler

Windows includes an automatic maintenance task called StartComponentCleanup. It runs in the background during system maintenance, but you can also start it manually.

Run the Task from Task Scheduler

  1. Press Win + R, type taskschd.msc, and press Enter.
  2. Open Task Scheduler Library β†’ Microsoft β†’ Windows β†’ Servicing.
  3. Find the task named StartComponentCleanup.
  4. Right-click it and choose Run.

Run the Same Task from Command Prompt

Run scheduled cleanup taskschtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"

This method is conservative and uses Windows scheduled servicing behavior. If you want faster and more direct cleanup, use the DISM command from the previous section.

Clean WinSxS with Disk Cleanup and Windows Update Cleanup

Disk Cleanup can remove old Windows Update files, including superseded update components stored through the component store. This is a good graphical option if you do not want to use commands.

  1. Press Win + R, type cleanmgr, and press Enter.
  2. Select drive C: if Windows asks which drive to clean.
  3. Click Clean up system files.
  4. Select Windows Update Cleanup.
  5. Optionally select other safe items such as Temporary files and Delivery Optimization Files.
  6. Click OK, then click Delete Files.
  7. Restart the PC if Windows asks for it.
βœ…
Good for beginners Disk Cleanup is slower than DISM in some cases, but it is easy to understand and avoids manual deletion of system files.

Use Storage Sense to Remove Old Windows Update Files

On Windows 10 and Windows 11, Storage Sense can automatically remove temporary files and some obsolete update-related files. It is not a direct replacement for DISM, but it is useful for regular maintenance.

  1. Open Settings.
  2. Go to System β†’ Storage.
  3. Open Temporary files.
  4. Select Windows Update Cleanup if it appears.
  5. Click Remove files.

To automate routine cleanup, enable Storage Sense on the Storage page and configure how often Windows should clean temporary files.

What You Should Not Delete from WinSxS

Because WinSxS is a protected system folder, deleting files from it manually is one of the fastest ways to corrupt Windows servicing. Even if the files appear old or duplicated, Windows may still use them through hard links or component manifests.

Action Risk Safe Alternative
Deleting files from C:\Windows\WinSxS Windows Update, DISM, and SFC may fail. Use Dism.exe /StartComponentCleanup.
Using third-party β€œsystem cleaner” tools on WinSxS Cleaner may remove files it does not understand. Use Microsoft servicing tools only.
Taking ownership of WinSxS to force deletion Permissions and servicing metadata can be damaged. Leave ownership and permissions unchanged.
Compressing the entire WinSxS folder manually Performance issues or servicing failures are possible. Free space with DISM, Disk Cleanup, or Storage Sense.

Troubleshooting WinSxS Cleanup Errors

If DISM cleanup fails, gets stuck, or reports component store corruption, use the following commands in order. Run them from an elevated Command Prompt, PowerShell, or Terminal window.

1. Check component store health

Dism.exe /Online /Cleanup-Image /ScanHealth

Scans the component store for corruption. This can take several minutes.

2. Repair component store

Dism.exe /Online /Cleanup-Image /RestoreHealth

Attempts to repair the Windows image using Windows Update or configured repair sources.

3. Check system files

sfc /scannow

Verifies protected Windows system files and replaces corrupted files when possible.

Common Problems and Solutions

Problem Possible Cause What to Try
DISM stays at 20% or 40% Normal DISM behavior or a slow disk. Wait. Do not close the window unless there is no disk or CPU activity for a long time.
Cleanup fails after Windows Update Pending reboot or unfinished servicing operation. Restart Windows and run the command again.
/AnalyzeComponentStore still recommends cleanup Some packages are still pending or reserved. Restart, install pending updates, then repeat the cleanup.
DISM reports source files could not be found Windows image repair needs a valid repair source. Use Windows Update, a matching ISO image, or a mounted install.wim/install.esd source.

Frequently Asked Questions About Cleaning WinSxS

Q Can I delete the WinSxS folder completely? β–Ό
No. The WinSxS folder is required by Windows. Deleting it completely can break Windows Update, optional features, system repair, and even normal boot or application behavior. Use DISM or Disk Cleanup instead.
Q Is DISM WinSxS cleanup safe? β–Ό
Yes, Dism.exe /Online /Cleanup-Image /StartComponentCleanup is the standard safe cleanup command. It removes superseded component versions that Windows servicing no longer needs. The more aggressive /ResetBase option is also supported, but it prevents uninstalling already superseded updates.
Q How much space can I recover by cleaning WinSxS? β–Ό
It depends on your update history, Windows version, optional features, and how long the system has been running without cleanup. Some PCs recover only a few hundred megabytes, while others recover several gigabytes after many cumulative updates.
Q Should I run WinSxS cleanup every day? β–Ό
No. Daily cleanup is unnecessary. Windows already performs component cleanup automatically during maintenance. Manual cleanup is useful after large cumulative updates, feature updates, or when the system drive is running low on space.
Q Is WinSxS cleanup the same as deleting temporary files? β–Ό
No. Temporary file cleanup removes files such as caches and old logs. WinSxS cleanup removes superseded Windows component versions through the Windows servicing system. That is why DISM is the preferred tool for component store cleanup.
Q Can I clean WinSxS on Windows Server the same way? β–Ό
Many DISM component cleanup commands also apply to Windows Server, but server environments may have stricter rollback, servicing, and maintenance requirements. On production servers, test first and follow your organization’s patch-management policy.

Best Way to Clean WinSxS in Windows 10 and Windows 11

The safest and most effective way to clean the WinSxS folder is to use the built-in Windows servicing tools. Start by analyzing the component store, then run the standard DISM cleanup command. Use /ResetBase only if the system is stable and you do not need to uninstall superseded updates.

⚑ Quick Recap

Check real WinSxS size: Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
Recommended cleanup: Dism.exe /Online /Cleanup-Image /StartComponentCleanup
Advanced cleanup: Dism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase
GUI method: Disk Cleanup β†’ Clean up system files β†’ Windows Update Cleanup
Never do: manually delete files from C:\Windows\WinSxS

Official Microsoft References