Windows 10: Clean Up Component Store (WinSxS folder) in Windows 10  

    Clean Up Component Store (WinSxS folder) in Windows 10

    Clean Up Component Store (WinSxS folder) in Windows 10

    How to Clean Up Component Store (WinSxS folder) in Windows 10
    Published by Category: Performance & Maintenance
    09 Oct 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 33,021

    Show Printable Version 


    How to Clean Up Component Store (WinSxS folder) in Windows 10

    information   Information
    One commonly asked question is can I delete the WinSxS folder to regain some disk space? The short answer is no. However, there are ways to reduce the size of the WinSxS folder.

    The component store (WinSxS folder) contains all the components that make-up Windows to allow you operate your system. These components are kept to rollback any problematic change or to repair a file that becomes corrupted.

    The WinSxS folder is located in the Windows folder, for example "C:\Windows\WinSxS". Itís the location for Windows Component Store files. The Windows Component Store is used to support the functions needed for the customization and updating of Windows. Here are some examples of how the Windows Component Store files are used:
    • Using Windows Update to install new component versions. This keeps systems secure and up-to-date.
    • Enabling or disabling Windows features.
    • Adding roles or features using Server Manager.
    • Moving systems between different Windows Editions.
    • System recovery from corruption or boot failures
    • Uninstalling problematic updates
    • Running programs using side-by-side assemblies

    Windows 10 and Windows Server 2016 automatically reduces the size of the WinSxS by using methods similar to the ones described in this tutorial, however these methods also include internal processes, such as uninstalling and deleting packages with components that have been replaced by other components with newer versions. Previous versions of some components are kept on the system for a period of time, allowing you to rollback if necessary. After a period of time, these components are removed from the installation.

    In Windows 10 and Windows Server 2016, you have a number of ways to start the cleanup of the component store, which use a combination of package deletion and component compression to clean up the WinSxS folder.

    For more information about the Windows Component Store (WinSxS folder), see:

    This tutorial will show you different ways on how to clean up the Component Store (WinSxS folder) to reduce its size in Windows 10.

    You must be signed in as an administrator to clean up the component store (WinSxS folder).

    Note   Note
    If you like, you can analyze the Component Store (WinSxS folder) first to see if it is recommended to clean up or not.


    CONTENTS:
    • Option One: Clean Up Component Store (WinSxS folder) using StartComponentCleanup Task
    • Option Two: Clean Up Component Store (WinSxS folder) using /StartComponentCleanup with Dism Command
    • Option Three: Clean Up Component Store (WinSxS folder) using /StartComponentCleanup and /ResetBase with Dism Command
    • Option Four: Clean Up Component Store (WinSxS folder) using /SPSuperseded with Dism Command





    Clean Up Component Store (WinSxS folder) in Windows 10 OPTION ONE Clean Up Component Store (WinSxS folder) in Windows 10
    Clean Up Component Store (WinSxS folder) using StartComponentCleanup Task

    Note   Note
    The StartComponentCleanup task was created in Windows 8 to regularly clean up components automatically when the system is not in use. This task is set to run automatically when triggered by the operating system. When run automatically, the task will wait at least 30 days after an updated component has been installed before uninstalling the previous versions of the component.

    If you choose to run this task, the task will have a 1 hour timeout and may not completely clean up all files.



    The StartComponentCleanup task can also be started from an elevated command prompt:

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


    1. Press the Win+R keys to open Run, type taskschd.msc into Run, and click/tap on OK to open Task Scheduler.

    2. Navigate to and open the folder below in the left pane of Task Scheduler. (see screenshot below step 3)

    Task Scheduler Library\Microsoft\Windows\Servicing


    3. In the middle pane of Servicing, select the StartComponentCleanup task, and click/tap on Run under Selected Item in the right pane. (see screenshot below)

    Click image for larger version. 

Name:	StartComponentCleanup_task-1.png 
Views:	524 
Size:	85.1 KB 
ID:	131513

    4. The StartComponentCleanup task will now be running until finished. This may take a while to finish running. (see screenshot below)

    Click image for larger version. 

Name:	StartComponentCleanup_task-2.png 
Views:	606 
Size:	84.6 KB 
ID:	131514





    Clean Up Component Store (WinSxS folder) in Windows 10 OPTION TWO Clean Up Component Store (WinSxS folder) in Windows 10
    Clean Up Component Store (WinSxS folder) using /StartComponentCleanup with Dism Command

    Note   Note
    Using the /StartComponentCleanup parameter of Dism.exe on a running version of Windows 10 gives you similar results to running the StartComponentCleanup task in Task Scheduler, except previous versions of updated components will be immediately deleted (without a 30 day grace period) and you will not have a 1-hour timeout limitation.


    1. Open an elevated command prompt.

    2. Enter the command below into the elevated command prompt, and press Enter. (see screenshot below)

    Dism.exe /online /Cleanup-Image /StartComponentCleanup


    3. When finished, you can close the elevated command prompt if you like. This may take a while to finish running.

    Name:  StartComponentCleanup_command.png
Views: 27217
Size:  13.9 KB





    Clean Up Component Store (WinSxS folder) in Windows 10 OPTION THREE Clean Up Component Store (WinSxS folder) in Windows 10
    Clean Up Component Store (WinSxS folder) using /StartComponentCleanup and /ResetBase with Dism Command

    Note   Note
    Using the /ResetBase switch with the /StartComponentCleanup parameter of DISM.exe on a running version of Windows 10 removes all superseded versions of every component in the component store.

    warning   Warning
    All existing service packs and updates cannot be uninstalled after this command is completed. This will not block the uninstallation of future service packs or updates.


    1. Open an elevated command prompt.

    2. Enter the command below into the elevated command prompt, and press Enter. (see screenshot below)

    Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase


    3. When finished, you can close the elevated command prompt if you like. This may take a while to finish running.

    Name:  StartComponentCleanup_ResetBase_command.png
Views: 27218
Size:  14.3 KB





    Clean Up Component Store (WinSxS folder) in Windows 10 OPTION FOUR Clean Up Component Store (WinSxS folder) in Windows 10
    Clean Up Component Store (WinSxS folder) using /SPSuperseded with Dism Command

    Note   Note
    To reduce the amount of space used by a Service Pack, use the /SPSuperseded parameter of Dism.exe on a running version of Windows 10 to remove any backup components needed for uninstallation of the service pack. A service pack is a collection of cumulative updates for a particular release of Windows.

    warning   Warning
    The service pack cannot be uninstalled after this command is completed.


    1. Open an elevated command prompt.

    2. Enter the command below into the elevated command prompt, and press Enter. (see screenshot below)

    Dism.exe /online /Cleanup-Image /SPSuperseded


    3. When finished, you can close the elevated command prompt if you like. This may take a while to finish running.

    Name:  SPSuperseded_command.png
Views: 27225
Size:  15.0 KB


    That's it,
    Shawn


  1.    6 Days Ago #1

    FWIW ...
    Seems like Win10 1809 is doing a better job of cleaning up after itself, when the Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase is run. I don't think it actually does the /ResetBase, unless you do the registry hack, but don't quote me on that ... I haven't done the registry hack to find out :)

    Note: I still check the C:\windows\winsxs\temp\ (Inflight,PendingDeletes,PendingRenames) folders to see if any folders/files are still there. Seems there's always a few files left in PendingDeletes that can't be deleted, until you boot to Command Prompt and delete them manually.
      My ComputersSystem Spec

  2.    5 Days Ago #2

    I did option 1 and it ran almost 2hrs.
      My ComputerSystem Spec


 

Tutorial Categories

Clean Up Component Store (WinSxS folder) in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Xbox Windows Phone


Related Threads
Since Creators update, whenever I run Dism /Online /Cleanup-Image /CheckHealth DISM /Online /Cleanup-Image /ScanHealth It results in "The component store is repairable. The operation completed successfully." Sfc /scannow shows no errors.
Performance & Maintenance Analyze Component Store (WinSxS folder) in Windows 10 in Tutorials
How to Analyze Component Store (WinSxS folder) in Windows 10 One commonly asked question is can I delete the WinSxS folder to regain some disk space? The short answer is no. However, there are ways to reduce the size of the WinSxS folder. The...
KB3194496 - Corrupts Component Store? in Windows Updates and Activation
Hi. I've been trying to install update KB3194496, but without success. Before installing it, DISM /CheckHealth reports "No component store corruption detected.". When trying to install the update, DISM aborts giving the error code 0x80073712...
I need to delete some WinSXS folder entries in Performance & Maintenance
I need to delete some WinSXS folder entries, no questions asked. How do I do that? Taking ownership and rights isn't enough it seems. The last won't work on all folders inside WinSXS. I keep getting errors when applying rights for my username...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:39.
Find Us