How to Save Space By Cleaning Windows' WinSxS Folder

  • MORE

Windows uses a system folder called WinSxS to store files that are needed for your Windows installation, as well as backups or updates to those files. It's a space hog, however, taking up several gigabytes of space and growing with each Windows Update you perform. Use the steps below to clean up unnecessary files in that WinSxS folder and reclaim valuable hard drive space.

You can't just delete everything in the WinSxS folder, because some of those files are needed for Windows to run and update reliably. However, with Windows 7 and above you can use the built-in Disk Cleanup tool to delete older versions of Windows updates you no longer need. With Windows 8.1 and Windows 10, you can use the Command Prompt to clean up the WinSxS folder as well.

Use Disk Cleanup to Delete Old Updates From the SxS Folder

1. Open the Disk Cleanup tool. You can do this by typing "disk cleanup" in the taskbar and clicking "Disk Cleanup"

start diskcleanup

2. Click the "Cleanup system files" button.

diskcleanup system

3. Check the box next to "Windows Update Cleanup."

diskcleanup updates(2)4. Click OK.

Note that if you don't see the Windows Update Cleanup option in Disk Cleanup, that means there aren't any files that can be safely deleted.

Use the Command Prompt to Clean Up the SxS Folder

If you want a more thorough view of how much space the SxS folder is taking up and the option to clean up unneeded files, use the Command Prompt.

1. Launch the command prompt with admin priviledges. You can do this by right-clicking on the Windows icon in the taskbar and click "Command Prompt (Admin)."

cmd admin(2)2. Enter the command: Dism.exe /online /Cleanup-Image /StartComponentCleanup

dism

It could take a few minutes for the DISM tool to analyze the folder. When it's done, you'll see size details of the components in the WinSxS folder and, at the bottom, a recommendation to clean it up or not.

3. If recommended, clean up the folder using this command in the Command Prompt: Dism.exe /online /Cleanup-Image /StartComponentCleanup

There's another command you can use to uninstall Windows updates and service packs, which saves more space, but we don't recommend you do that, because you won't be able to uninstall any current service updates or service packs after performing this. The command is Dism.exe /online /Cleanup-Image /StartComponentCleanup

The cleanup might take some time, depending on your system and how much you're deleting, but that extra space will be worth it.

Add a comment
22 comments
  • Archangel Tyrael Says:

    Might as well type "Format: C\" for three times

  • marine33 Says:

    What had just happened!!
    Step 2: Enter the command [[the-same-command]]

    Step 3: See results of Step 2 and enter the command [[the-same-command]]
    (thoughts: OK, it means re-enter it... for confirmation??)

    End of Step 3: "We won't recommend you use... [[the-same-command]].

    Ahh!!!!!!!!!!!!!.............

  • Tony Fiorentino Says:

    I launch "Disk Cleanup", but there is no "Cleanup System Files" button. In fact, it doesn' look at all like the same layout. I made sure that I am completely updated, but no luck. I have a 32 bit machine and not a 64 bit. Could that be why I don't have the backwardly migrated version of Disk Cleanup?

  • AverageJoe Says:

    Considering the publication date of this article, the many comments pointing out the inaccuracies, the lack of responsibility and accountability shown by not editing the article - which obviously gets a lot of hits being ranked so high on Google, I for one, will not respect anything published by the Author nor Laptop for the foreseeable future.

  • Duane Says:

    Too all those complaining about this article please show her errors!
    Her examples coincide with Microsoft recommendations.

  • HHGregg Says:

    Looks like she started working for Zapier about a month after writing this article. She is giving out bad advice there now I guess.

  • Lewej Says:

    Can we get this taken down if it is so wrong. More of a hindrance than a help. Thanks goodness for the comments - which saved the day.

  • JD Grant Says:

    Well, I've learned one thing, at least: never follow "expert" advice without first reading the comments. Melanie doesn't even make it to step 2 without making a mistake, and--thanks to her--I've made the same mistake. I now have more problems than I had before I came to this site. Thanks, Melanie! I won't be listening to you again.

  • Al Breeck Says:

    I ran the Disk CleanUp Tool and then Cleanup System Files - with little to delete.
    I could just go to C:\Windows and check SIZE of \WinSXS or instead run this:

    DO NOT do the Commands as listed above, see the comments. THANKS to Andrew you should start with
    (in Command Prompt - Adminstrator:
    DISM /Online /Cleanup-Image /AnalyzeComponentStore

    And then see listed when done:

    Deployment Image Servicing and Management tool
    Version: 10.0.14393.0

    Image Version: 10.0.14393.0

    [==========================100.0%==========================]

    Component Store (WinSxS) information:

    Windows Explorer Reported Size of Component Store : 4.42 GB

    Actual Size of Component Store : 4.30 GB

    Shared with Windows : 3.69 GB
    Backups and Disabled Features : 452.09 MB
    Cache and Temporary Data : 155.11 MB

    Date of Last Cleanup : 2017-04-12 00:15:00

    Number of Reclaimable Packages : 0
    Component Store Cleanup Recommended : No

    The operation completed successfully.

    This could also be done in Windows Powershell (Adminstrator):
    DISM -Online -Cleanup-Image -AnalyzeComponentStore

    for exactly same results.

  • johny why Says:

    hi,
    the commands in steps 2 and 3 are identical. is that correct?
    thx

  • MasterCylinder Says:

    And ... please read the comments below to get the real solutions!

  • MasterCylinder Says:

    It is amazing that Melanie put this out yet is not taking any responsibility for it's accuracy.

    I would NOT recommend using 'Disk Cleanup'for system files - I have always had unpredictable results with this. Too many settings and stuff are deleted apparently and you'll end up with a whole lot of work to do to get your system back to where it was.

  • Timothy Baker Says:

    Hi,
    I just wanted to let you know that you gave some bad information at the end of your article.

    You state that in order to remove updates and servicepacks you should use the command "dism.exe/online /cleanup-image /startcomponentcleanup"

    Please refer to the microsoft documentation on the DISM /online /cleanupimage tool below.

    By analyzing this documentation we can learn that in order to find out exactly what there is in the componentstore we can use the command DISM /Cleanup-Image /AnalyzeComponentStore

    To access this help file, or help on any of the cmd/powershell tools just add a /? to the end of your command.

    PS C:\Users\administrator> DISM /online /cleanup-image /?

    Deployment Image Servicing and Management tool
    Version: 10.0.14393.0

    Image Version: 10.0.14393.0


    /Cleanup-Image /RevertPendingActions

    WARNING! You should use the /RevertPendingActions option only in a
    system-recovery scenario to perform recovery operations on a Windows image
    that did not boot.

    Example:
    DISM.exe /Image:C:\test\offline /Cleanup-Image /RevertPendingActions

    /Cleanup-Image /spsuperseded [/hidesp]
    Use /SPSuperseded to remove any backup files created during the installation
    of a service pack. Use /HideSP to prevent the service pack from being listed
    in the Installed Updates for the operating system.

    WARNING! The service pack cannot be uninstalled after the /SPSuperseded
    operation is completed.

    Example:
    DISM.exe /Image:C:\test\offline /Cleanup-Image /spsuperseded /hidesp

    /Cleanup-Image {/CheckHealth | /ScanHealth | /RestoreHealth}
    Use /CheckHealth to check whether the image has been flagged as corrupted
    by a failed process and whether the corruption can be repaired.
    Use /ScanHealth to scan the image for component store corruption.
    Use /RestoreHealth to scan the image for component store corruption, and
    then perform repair operations automatically.
    Use /Source with /RestoreHealth to specify the location of known good
    versions of files that can be used for the repair. For more information on
    specifying a source location, see
    http://go.microsoft.com/fwlink/?LinkId=243077.
    Use /LimitAccess to prevent DISM from contacting WU/WSUS.

    Example:
    DISM.exe /Online /Cleanup-Image /ScanHealth

    DISM.exe /Image:c:\offline /Cleanup-Image /RestoreHealth
    /Source:c:\test\mount

    /Cleanup-Image /StartComponentCleanup [/ResetBase [/Defer]]
    Use /StartComponentCleanup to clean up the superseded components and reduce
    the size of the component store. Use /ResetBase to reset the base of
    superseded components, which can further reduce the component store size.
    Use /Defer with /ResetBase to defer long-running cleanup operations to the
    next automatic maintenance.

    WARNING! The installed Windows Updates cannot be uninstalled after the
    /StartComponentCleanup with /ResetBase operation is completed.

    Example:
    DISM.exe /Image:C:\test\offline /Cleanup-Image /StartComponentCleanup

    /Cleanup-Image /AnalyzeComponentStore
    Use /AnalyzeComponentStore to create a report of the WinSxS component store.
    For more information about the WinSxS report and how to use the information
    provided in the report, see
    http://go.microsoft.com/fwlink/?LinkId=293367.

    Example:
    DISM.exe /Image:C:\test\offline /Cleanup-Image /AnalyzeComponentStore

  • nanaaaaaaaaaaaa Says:

    if you get error 87, run this: dism /Online /Cleanup-Image /spsuperseded

  • Joshua Says:

    Update the damn article!

    @Andrew You're a godsend. Thank you

  • Hello McFly Says:

    Melanie, you STILL haven't fixed what you published. Proofread.

    @Andrew thank you

  • Charli Says:

    My analysis recommended NOT cleaning up the component store. Now what do I do? My C drive is almost at 100% capacity!

  • Ben Skidmore Says:

    Hi! You have listed the cleanup command for both steps, meaning that I ran the cleanup instead of the analysis first time. Not a problem but it's worth editing as I found this page pretty high up in a Google search (and it was pretty helpful! Thanks!)

    Best regards

    Ben

  • 64kRAM Says:

    @Melanie - You should proof read your articles before you publish them.

    @Andrew - Thank you for the corrections.

  • Andrew Says:

    3. I should say older versions of Service Packs and updates. So you cannot go back to a position before anymore.

  • Andrew Says:

    1. AnalyzeComponentStore
    2. StartComponentCleanup
    3. SPSuperseded
    The last clears out copies of Service Packs and updates.

  • chucko Says:

    Please take a look at the article. You basically have the user run the same command three times in a row.

Back to top