When you run a component store cleanup using DISM.exe’s /startcomponentcleanup parameter, the command doesn’t finish correctly. The output shows that the process has stopped at 20%, but the message says, “The operation completed successfully.”

You may wonder how to reclaim the disk space the component store uses.
See also: How to Clean Up the Component Store (WinSxS)
Resolution
To fix the issue, uninstall and reinstall a feature (Feature-on-Demand). It can be any feature or capability.
Example 1: Remove and reinstall XPS Viewer
For example, try uninstalling and reinstalling the XPS Viewer. The commands are below:
dism /online /remove-capability /capabilityname:XPS.Viewer~~~~0.0.1.0
Restart Windows.
And then, run the following commands:
dism /online /add-capability /capabilityname:XPS.Viewer~~~~0.0.1.0
Restart Windows again if prompted.
Then, run:
dism /online /cleanup-image /startcomponentcleanup
Let’s say you never use Telnet client and it’s not installed on the computer. So, let’s install Telnet Client and then remove it.
Example 2: Install Telnet Client and Uninstall it
To install and then uninstall the Telnet Client, run these commands
Dism /online /Enable-Feature /FeatureName:TelnetClient
Restart Windows and then run:
Dism /online /Disable-Feature /FeatureName:TelnetClient
Dism /online /Cleanup-Image /StartComponentCleanup
The component cleanup should now complete successfully (100%).
If that doesn’t help, do an in-place upgrade (a.k.a. repair installation) by downloading the Media Creation Tool. Or you may download the Windows ISO, mount the ISO, and run setup.exe.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
Thanks, the install and uninstall feature worked to fix hanging Component Store Cleanup at 20%.