DISM Component Store Cleanup

DISM Component Store Cleanup

This morning, I recalled the value of occasional “check-and-clean” operations on the Windows Component Store (aka WinSxS). Check the “Before and After” screencap at the top of this story. It shows that applying updates can leave old components behind. Checking the component store tells you what’s up. Performing a DISM component store cleanup recovers wasted space. To wit: 1.72 GB in reported size, and 1.47 GB in actual size.

How to run DISM Component Store Cleanup

What you see in the before (left) and after (right) image is syntax to check the Windows Component Store. Run it in an admin cmd or PowerShell session, like so:

DISM /online /cleanup-image /analyzecomponentstore

Two notes. One, the output from the before (left) tells you how many reclaimable packages are found (2, in this instance). Two, it tells you whether or not component store cleanup is recommended (yes, this time around). Running the check and report syntax shown above takes 1-2 minutes on most Windows 10 and 11 PCs.

Performing the Actual Cleanup

As with the check and report DISM command, the cleanup command must also run in an administrative cmd or PowerShell session. That syntax is slightly different:
DISM /online /cleanup-image /startcomponentcleanup
Depending on how many reclaimable packages are found, and how big they are, cleanup can take upwards of 5 minutes on most Windows 10 or 11 PCs. That wait goes up, as the number (and total) size of packages increases. Be patient! I’ve only had this fail a handful of times over the years I’ve been using this tool (and many of those failures were self-inflicted because of prior use of /resetbase, which locks existing packages into place in the Component Store).

Nevertheless, this is an excellent and recommended Windows cleanup technique, which I try to run after each month’s Cumulative Update (CU) is installed. The check and report command doesn’t always find something to cleanup, but when it does, I follow up with the /startcomponentcleanup to trim down the Component Store footprint. It’s a great technique for regular Windows image management, in fact.

Facebooklinkedin
Facebooklinkedin

Leave a Reply

Your email address will not be published. Required fields are marked *