Share via

Windows Component Cleanup

Lysa Analyst 0 Reputation points
2026-06-23T13:06:38.0266667+00:00

Our IT imaging team noticed that after multiple rounds of monthly Windows updates, the C:\Windows\WinSxS folder grows incredibly large, eating up precious solid-state drive space. What is the safe PowerShell or DISM command line to perform a component cleanup and permanently remove superseded update files?

Windows for business | Windows 365 Enterprise
0 comments No comments

1 answer

Sort by: Most helpful
  1. Marcin Policht 93,360 Reputation points MVP Volunteer Moderator
    2026-06-23T13:13:46.5766667+00:00

    Use DISM component cleanup against the running operating system. This removes superseded component versions from the WinSxS store while keeping the system in a supported state. Run the following command from an elevated Command Prompt or PowerShell session:

    DISM /Online /Cleanup-Image /StartComponentCleanup
    

    This performs a standard component store cleanup and removes older replaced component versions that are no longer needed after Windows updates.

    If you want to permanently remove all superseded components and prevent uninstalling older updates or service packs, use:

    DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase
    

    The /ResetBase option significantly reduces WinSxS size because every currently installed update becomes permanent. After running it, previously installed updates can no longer be uninstalled, so it is best used only after validating system stability and patch compliance.

    You can also automate the cleanup with PowerShell:

    Start-Process dism.exe -ArgumentList '/Online','/Cleanup-Image','/StartComponentCleanup','/ResetBase' -Wait -Verb RunAs
    

    Before cleanup, you can analyze the component store size with:

    DISM /Online /Cleanup-Image /AnalyzeComponentStore
    
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.