System Analyze and Clean Up Component Store (WinSxS folder) in Windows 11


Disk_Cleanup_banner.png

This tutorial will show you how to analyze and clean up the component store (WinSxS folder) to reduce its size in Windows 10 and Windows 11.

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
The component store (WinSxS folder) contains components that make-up Windows and allow you operate your system. These components are kept in this folder in case you need to rollback changes or repair corrupted files.

Files in this folder might appear to be stored in more than one place in the operating system, but there's usually only one copy of the file and the rest of the copies are actually hard links. Some tools, such as the File Explorer, determine the size of directories without taking into account that the contained files might be hard linked, which might lead you to think that the WinSxS folder takes up more disk space than it really does.

The operating system automatically reduces the size of the WinSxS folder by using methods similar to the ones described in this topic. Windows also uses internal processes to reduce the size of the WinSxS folder, 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 older components are automatically removed from the installation.

See also:

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.


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


Some important system files are located only in the WinSxS folder. Deleting files from the WinSxS folder or deleting the entire WinSxS folder might severely damage your system, so that your PC might not boot, and make it impossible to update.

You can instead reduce the size of the WinSxS folder using tools built into Windows.



Contents

  • Option One: Analyze the Component Store (WinSxS folder)
  • Option Two: Clean Up Component Store (WinSxS folder) using StartComponentCleanup task in Task Scheduler
  • Option Three: Clean Up Component Store (WinSxS folder) using /StartComponentCleanup Command
  • Option Four: Clean Up Component Store (WinSxS folder) using /StartComponentCleanup /ResetBase Command




Option One

Analyze the Component Store (WinSxS folder)


This option is used to determine the actual size of the WinSxS folder, and if clean up is recommended.


1 Open Windows Terminal (Admin), and select either Windows PowerShell or Command Prompt.

2 Copy and paste the command below into Windows Terminal (Admin), and press Enter. (see screenshot below)

DISM /Online /Cleanup-Image /AnalyzeComponentStore

3 Based on the output, you can determine the overhead of the WinSxS folder by taking the sum of the backups and disabled features size with the cache and temporary data size.

In this example, the WinSxS folder appears to be 7.15 GB, but the actual overhead (the sum of the size of Backups and Disabled Features and the size of Cache and Temporary Data) is 1.16 GB.


4 Component Store Cleanup Recommended will report Yes or No if cleanup is needed.

Here's the information that's available in the output:

Title​
Description​
Windows Explorer Reported Size of Component StoreThis value the size of the WinSxS folder if computed by Windows Explorer. This value doesn’t factor in the use of hard links within the WinSxS folder.
Actual Size of Component StoreThis value factors in hard links within the WinSxS folder. It doesn’t exclude files that are shared with Windows by using hard links.
Shared with WindowsThis value provides the size of files that are hard linked so that they appear both in the component store and in other locations (for the normal operation of Windows). This is included in the actual size, but shouldn’t be considered part of the component store overhead.
Backups and Disabled FeaturesThis is the size of the components that are being kept to respond to failures in newer components or to provide the option of enabling more functionality. It also includes the size of component store metadata and side-by-side components.

This is included in the actual size and is part of the component store overhead.
Cache and Temporary DataThis is the size of files that are used internally by the component store to make component servicing operations faster. This is included in the actual size and is part of the component store overhead.
Date of Last CleanupThis is the date of the most recently completed component store cleanup.
Number of Reclaimable PackagesThis is the number of superseded packages on the system that component cleanup can remove.
Component Store Cleanup RecommendedThis is a component store cleanup recommendation. Cleanup is recommended when performing a cleanup process may reduce the size of the component store overhead.

Analyze_Component_Store_WinSxS_folder.png





Option Two

Clean Up Component Store (WinSxS folder) using StartComponentCleanup task in Task Scheduler


The StartComponentCleanup task automatically cleans up components when the system isn't in use. 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.

You can also run StartComponentCleanup task using the command below in Windows Terminal (Admin).

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


1 Open Task Scheduler (taskschd.msc).

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 Select the StartComponentCleanup task in the middle pane of Servicing, and click/tap on Run under Selected Item in the right Actions pane. (see screenshot below)

StartComponentCleanup_from_Task_Scheduler-1.png

4 The StartComponentCleanup task will now run until finished or the 1 hour timeout has been reached. This can take a while to finish running. (see screenshot below)

StartComponentCleanup_from_Task_Scheduler-2.png




Option Three

Clean Up Component Store (WinSxS folder) using /StartComponentCleanup Command


Using the /StartComponentCleanup parameter of Dism.exe 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 Windows Terminal (Admin), and select either Windows PowerShell or Command Prompt.

2 Copy and paste the command below into Windows Terminal (Admin), and press Enter. (see screenshot below)

DISM /Online /Cleanup-Image /StartComponentCleanup

3 When you see The operation completed successfully, you can close Windows Terminal (Admin) if you like. It may take a while to finish running.

StartComponentCleanup.png





Option Four

Clean Up Component Store (WinSxS folder) using /StartComponentCleanup /ResetBase Command


Using the /ResetBase parameter together with the /StartComponentCleanup parameter of DISM.exe removes all superseded versions of every component in the component store.


All existing update packages can't be uninstalled after this command is completed, but this won't block the uninstallation of future update packages.


1 Open Windows Terminal (Admin), and select either Windows PowerShell or Command Prompt.

2 Copy and paste the command below into Windows Terminal (Admin), and press Enter. (see screenshot below)

DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase

3 When you see The operation completed successfully, you can close Windows Terminal (Admin) if you like. It may take a while to finish running.

StartComponentCleanup_ResetBase.png



That's it,
Shawn Brink


 
Last edited:
No, just the recovery option in Settings (which fails). But for now I want to talk about the problem I posted. Thanks.
 

My Computer

System One

  • OS
    W10, W11
    Computer type
    PC/Desktop
    Manufacturer/Model
    2 HP Desktops, 1 Dell Desktop, 2 Dell XPS Laptops, 1 HP Laptop
What was the Windows update error message?
Please post images or share links.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
Install error - 0x800f081f
 

My Computer

System One

  • OS
    W10, W11
    Computer type
    PC/Desktop
    Manufacturer/Model
    2 HP Desktops, 1 Dell Desktop, 2 Dell XPS Laptops, 1 HP Laptop
Please run Tuneup plus > post a share link





Then run:
dism /online /cleanup-image /startcomponentcleanup
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
Did you see my post (# 20 in this thread)?
 

My Computer

System One

  • OS
    W10, W11
    Computer type
    PC/Desktop
    Manufacturer/Model
    2 HP Desktops, 1 Dell Desktop, 2 Dell XPS Laptops, 1 HP Laptop
yes we all see it. but like i stated, in-place is your best bet. this whole thing has been addressed in other threads. look at what worked in post #15 here
 

My Computer

System One

  • OS
    Windows 11 Pro
A file may be missing from the component store.

Other steps are for "detective work".

Tuneup plus runs scannow, scanhealth and restorehealth > see if it finds any problems

An in place upgrade repair often fixes 0x800f081f.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
Okay, I'll stop being stubborn :). I appreciate the help and will run the in place upgrade later today. thanks.
 

My Computer

System One

  • OS
    W10, W11
    Computer type
    PC/Desktop
    Manufacturer/Model
    2 HP Desktops, 1 Dell Desktop, 2 Dell XPS Laptops, 1 HP Laptop
Thanks for twisting my arm guys. All good now.
 

My Computer

System One

  • OS
    W10, W11
    Computer type
    PC/Desktop
    Manufacturer/Model
    2 HP Desktops, 1 Dell Desktop, 2 Dell XPS Laptops, 1 HP Laptop

Latest Support Threads

Back
Top Bottom