Skip to content
Join readers who trust AllThings.How for practical guides Opens in a new tab

How to Safely Shrink the WinSxS Folder in Windows 11

Pallav Pathak
How to Safely Shrink the WinSxS Folder in Windows 11

The WinSxS folder sits inside C:\Windows\WinSxS and holds the Windows component store, which keeps the files needed to install updates, enable optional features, roll back changes, and repair the operating system. It grows over time as Windows 11 retains older versions of components alongside newer ones, and File Explorer usually reports it as much larger than it really is because most of its contents are hard links to files that already exist elsewhere on the drive.

Quick answer: Open an elevated terminal and run Dism.exe /online /Cleanup-Image /StartComponentCleanup. To remove all superseded component versions, append /ResetBase, knowing that installed updates can no longer be uninstalled afterward.

⚠️
Never delete files inside WinSxS manually or remove the folder itself. Doing so can prevent Windows 11 from booting, block future updates, and break system repair.

Check the real size before cleaning

File Explorer counts hard-linked files multiple times, so the reported size is misleading. The accurate figure comes from DISM's component store analysis, which also tells you whether a cleanup will actually free space.

Open Terminal as administrator and run:


Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

The output breaks the store into categories that explain where the space goes and how much of it is actually reclaimable.

FieldWhat it means
Windows Explorer Reported SizeThe inflated size Explorer shows, counting hard links multiple times.
Actual Size of Component StoreThe true on-disk footprint after accounting for hard links.
Shared with WindowsFiles used by the running system through hard links. Not real overhead.
Backups and Disabled FeaturesOlder component versions and disabled feature payloads kept for rollback.
Cache and Temporary DataInternal servicing data used to speed up updates and cleanup.
Number of Reclaimable PackagesSuperseded packages that cleanup can remove.
Component Store Cleanup RecommendedYes or No, based on whether cleanup would meaningfully shrink the store.

The actual overhead is roughly the sum of Backups and Disabled Features plus Cache and Temporary Data. Everything else is either shared with Windows or essential system data that cleanup will not touch.


Run the StartComponentCleanup scheduled task

Windows 11 already ships with an automatic cleanup job called StartComponentCleanup. It runs during idle time and waits at least 30 days after an update before removing the previous version of a component, giving you a window to uninstall a problematic update. When you trigger it manually, the same 30-day grace period applies, and the task has a one-hour timeout, so it may not finish in a single pass on heavily updated systems.

Step 1: Press the Windows key, type Task Scheduler, and open the app. In the left pane, expand to Task Scheduler Library\Microsoft\Windows\Servicing.

Step 2: Select the StartComponentCleanup task in the middle pane, then click Run under Selected Item on the right. The task starts silently and works in the background.

Step 3: Watch for the TiWorker.exe process (Windows Modules Installer Worker) in Task Manager to confirm it is running. Let it finish on its own, or click End in Task Scheduler if you need to stop it early.

You can also kick it off from an elevated Command Prompt or PowerShell with a single line:


schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"

A SUCCESS message means the scheduler accepted the request. Cleanup itself continues in the background.

To make this routine, you can add a custom Trigger to the task so it runs on a schedule of your choosing, such as monthly after Patch Tuesday.


Use DISM for a deeper cleanup

DISM gives you the same engine without the 30-day wait and without the one-hour timeout. It is the preferred option after a large feature update or cumulative update has bloated the store.

Open Terminal as administrator and run:


Dism.exe /online /Cleanup-Image /StartComponentCleanup

This removes superseded component versions immediately and applies delta compression where possible. Expect it to take several minutes on a typical PC and longer on systems with years of update history.

winsxs folder cleanup windows 11
Running the DISM StartComponentCleanup command in an elevated terminal.

When the operation finishes, run Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore again to compare the new size against the original.


Reclaim more space with /ResetBase

The /ResetBase switch goes further by stripping out every superseded version of every component. The trade-off is permanent: once it completes, you cannot uninstall any update that was already on the system. Future updates can still be removed normally.


Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
⚠️
Only run /ResetBase on a stable system you are confident you will not need to roll back. After it completes, installed updates become a permanent part of the base image.

For systems with a service pack still present (rare on modern Windows 11 installs), the equivalent legacy command is:


Dism.exe /online /Cleanup-Image /SPSuperseded

After running it, the service pack can no longer be uninstalled.


Disk Cleanup and Storage Sense for casual cleanup

If you prefer a graphical tool, the built-in Disk Cleanup utility can remove Windows Update leftovers that contribute to component store overhead.

Step 1: Press Win + R, type cleanmgr, and press Enter. Pick the system drive and click OK.

Step 2: Click Clean up system files, choose the system drive again, then tick Windows Update Cleanup along with any other entries you want to remove. Click OK to start.

Storage Sense in Settings handles temporary files and is useful alongside DISM, but it does not directly clean the WinSxS folder. Open Settings > System > Storage > Temporary files, deselect the Recycle Bin and Downloads if you want to keep them, and click Remove files.


What each method actually does

MethodRemovesCaveat
Task Scheduler (StartComponentCleanup)Component versions older than 30 days1-hour timeout; may not finish in one run
DISM /StartComponentCleanupAll superseded component versions, immediatelyNo 30-day grace; takes longer than the scheduled task
DISM /StartComponentCleanup /ResetBaseEvery superseded version of every componentExisting updates can never be uninstalled
DISM /SPSupersededService pack backup filesService pack cannot be uninstalled afterward
Disk Cleanup (Windows Update Cleanup)Old Windows Update payloadsSmaller savings than DISM in most cases

How to confirm cleanup worked

Re-run Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore and compare the Actual Size of Component Store, Number of Reclaimable Packages, and Date of Last Cleanup against the values from before. A successful cleanup updates the cleanup date, reduces reclaimable packages toward zero, and lowers the actual size. The Component Store Cleanup Recommended line typically flips to No once there is nothing meaningful left to remove.

If you ran /ResetBase, expect the largest drop, often several gigabytes after a recent feature update. If the size barely changes, the system was already optimized and the automatic StartComponentCleanup task has been doing its job in the background.


Common reasons cleanup does not free space

  • The 30-day grace period is still active for recent updates when you run the scheduled task. Use DISM with /StartComponentCleanup to bypass it.
  • Another servicing operation is in progress. Reboot, then rerun the command.
  • You ran /ResetBase previously and there are no superseded versions left to remove.
  • Most of the reported size is shared with Windows through hard links, which cleanup will not and should not remove.

Treat the component store as a self-maintaining system that occasionally needs a nudge, not a folder you manage by hand. Stick to DISM, the StartComponentCleanup task, and Disk Cleanup, and Windows 11 will keep itself trim without risking the next update or recovery.