System Add WinSxS Component Store Cleanup Context Menu in Windows 11


  • Staff
Disk_Cleanup_banner.png

This tutorial will show you how to add a Component Store Cleanup desktop context menu for all users 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.

You can manually analyze and clean up the component store (WinSxS folder) to reduce its size in Windows 10 and Windows 11.


You must be signed in as an administrator to add, remove, and use the "Component Store Cleanup" context menu.



EXAMPLE: Component Store Cleanup context menu and results

You will need to click/tap on Show more options first by default, then click/tap on Component Store Cleanup.



Show_more_options.png
Component_Store_Cleanup_context_menu.png

Analyze_Component_Store.png
StartComponentCleanup.png



Here's How:

1 Do step 2 (add) or step 3 (remove) below for what you would like to do.

2 Add Component Store Cleanup Context Menu

A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Add_Component_Store_Cleanup_context_menu.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\WinSxS]
"Icon"="cleanmgr.exe"
"MUIVerb"="Component Store Cleanup"
"Position"="Bottom"
"SubCommands"=""


[HKEY_CLASSES_ROOT\DesktopBackground\shell\WinSxS\shell\001menu]
"HasLUAShield"=""
"MUIVerb"="Analyze Component Store"

[HKEY_CLASSES_ROOT\DesktopBackground\shell\WinSxS\shell\001menu\command]
@="PowerShell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/s,/k, DISM /Online /Cleanup-Image /AnalyzeComponentStore' -Verb runAs\""


[HKEY_CLASSES_ROOT\DesktopBackground\shell\WinSxS\shell\002menu]
"HasLUAShield"=""
"MUIVerb"="Clean Up Component Store"

[HKEY_CLASSES_ROOT\DesktopBackground\shell\WinSxS\shell\002menu\command]
@="PowerShell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/s,/k, DISM /Online /Cleanup-Image /StartComponentCleanup' -Verb runAs\""

3 Remove Component Store Cleanup Context Menu

This is the default setting.


A) Click/tap on the Download button below to download the file below, and go to step 4 below.​

Remove_Component_Store_Cleanup_context_menu.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\DesktopBackground\Shell\WinSxS]

4 Save the .reg file to your desktop.

5 Double click/tap on the downloaded .reg file to merge it.

6 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

7 You can now delete the downloaded .reg file if you like.


That's it,
Shawn Brink


 

Attachments

  • Add_Component_Store_Cleanup_context_menu.reg
    2.1 KB · Views: 231
  • Remove_Component_Store_Cleanup_context_menu.reg
    540 bytes · Views: 228
Last edited:

Latest Support Threads

Latest Tutorials

Back
Top Bottom