Skip to content

Instantly share code, notes, and snippets.

@74Thirsty
Created November 15, 2025 06:18
Show Gist options
  • Select an option

  • Save 74Thirsty/18e2b9152c0ca3a2f5d76dcd1b5d6ff4 to your computer and use it in GitHub Desktop.

Select an option

Save 74Thirsty/18e2b9152c0ca3a2f5d76dcd1b5d6ff4 to your computer and use it in GitHub Desktop.

Here’s the correct and complete way to fix a corrupted Windows Component Store on Windows 11.

The Component Store = WinSxS, and when it becomes corrupted, DISM and SFC are the tools to repair it.

Below is the clean repair path that actually works.


✅ 1. Open an Elevated Command Prompt

Press:

Start → type "cmd" → right-click → Run as administrator

✅ 2. Run DISM Health Check

First see the status:

DISM /Online /Cleanup-Image /CheckHealth

If it says corruption might exist, continue.


✅ 3. Scan for Problems

This scans the component store for issues:

DISM /Online /Cleanup-Image /ScanHealth

This can take 5–10 minutes.


✅ 4. Repair the Component Store (MAIN FIX)

This is the command that actually repairs corruption:

DISM /Online /Cleanup-Image /RestoreHealth

If the corruption is repairable using Windows Update, this should fix it.


🛠️ If DISM Cannot Repair (Error 0x800...)

Sometimes DISM says:

The source files could not be found.

Then you need to supply a clean source from a Windows ISO.

Step A: Download Windows 11 ISO

From Microsoft’s official site → “Download Windows 11 Disk Image (ISO)”.

Step B: Mount the ISO

Double-click the .iso → it appears as a new drive letter, for example:

D:\

Step C: Run DISM with the ISO as the repair source:

DISM /Online /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /LimitAccess

If your ISO uses install.esd instead of install.wim:

DISM /Online /Cleanup-Image /RestoreHealth /Source:D:\sources\install.esd /LimitAccess

✅ 5. Run System File Checker

Once the Component Store is repaired, fix system files:

sfc /scannow

This should finish with:

Windows Resource Protection found no integrity violations or Windows Resource Protection repaired corrupt files


🧹 6. Optional: Clean Up the Component Store

After everything is repaired, run:

Dism.exe /online /cleanup-image /startcomponentcleanup

This removes superseded WinSxS files and reduces corruption chance.


🔥 7. If Problems Still Remain

Try these additional fixes:

➤ Reset Windows Update components

Run, one line at a time:

net stop wuauserv
net stop cryptsvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
net start wuauserv
net start cryptsvc
net start bits
net start msiserver

➤ Repair Windows In-Place (No Data Loss)

The strongest fix:

  1. Run setup.exe from the Windows 11 ISO
  2. Choose Keep everything
  3. Let Windows reinstall itself in-place

This fixes every corrupted system file without wiping your PC.


If you want, I can:

✅ Diagnose specific DISM or SFC errors you’re getting ✅ Tell you whether your corruption is repairable or requires ISO ✅ Generate a one-shot repair script for you

Just send the DISM/SFC output.

@djibe

djibe commented Oct 9, 2026

Copy link
Copy Markdown

When /cleanup-image is unknown (error 87), use DISM /Apply-Image /ImageFile:F:\Sources\install.wim /Index:6 /ApplyDir:C: /Compact

F: is the drive where I extracted Win11.iso.
/Index:6 is French version (list all languages with: DISM.exe /Get-WimInfo /WimFile:F:\Sources\install.wim)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment