Forum Discussion
Unable to use RestoreHealth in DISM
Hi all,
I had a windows update fail with 0x800f0831 which indicates corrup files.
So I ran the DISM commands
DISM /ONLINE /CLEANUP-IMAGE /SCANHEALTHD
DISM /ONLINE /CLEANUP-IMAGE /CHECKHEALTH
DISM /ONLINE /CLEANUP-IMAGE /RESTOREHEALTH
However RestoreHealth failed saying it could not find the source
So I tried
DISM /Online /Cleanup-Image /RestoreHealth /Source:H:\Sources\install.wim /LimitAccess
and again it stated it could not find the source.
So I inspected the install.wim file and my system Win11 Pro is actually on index 6, so I then tried
DISM /Online /Cleanup-Image /RestoreHealth /Source:H:\Sources\install.wim:6 /LimitAccess
And still it could not find the source.?
So what is going on?
4 Replies
- QueenOfKeysReemaBrass Contributor
Hi!
I’m happy to help — and since I’m a developer, I can guide you through the advanced DISM steps that usually fix this issue.
1) Make sure the WIM index matches your edition
For Windows 11 Pro, the index is usually 6, but not always.
Run:
dism /Get-WimInfo /WimFile:H:\sources\install.wim
2) Use the full source path
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:H:\sources\install.wim:6 /LimitAccess
3) If it still fails, use the ESD instead of WIM
DISM /Online /Cleanup-Image /RestoreHealth /Source:esd:H:\sources\install.esd:6 /LimitAccess
4) Or repair using Windows Update directly
DISM /Online /Cleanup-Image /RestoreHealth /Source:RepairSource /LimitAccess
If you want, I can help you read the DISM log and find the exact missing component.
Make sure the drive letter for source files is correct.
Simply mount Windows 11 ISO and identify drive letter.
- Attila MatyasBrass Contributor
The Disk name is usually originally "C" not "D", but if you have installed an operating system on the "D" disk, that's one thing. Before the Commands, you should always start with "sfc /scannow", and if it finds something, then when you restart your computer, you type the commands in order.
Component store corruption is no problem with the system files, but simply the software distribution folder in windows is full of all kinds of things, you want to get rid of.
1) Dism.exe /online /Cleanup-Image /checkhealth
2) Dism.exe /online /Cleanup-Image /scanhealth
3) Dism.exe /online /Cleanup-Image /Restorehealth
4) sfc /scannow
5) Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
6) Dism.exe /Online /Cleanup-Image /StartComponentCleanup
But as I mentioned, always start with sfc/scannow, and after the commands in order. The name of the drive is doesn´t matter.
The next step is to delete the "Software Distribution" folder in Windows. Which is located in the Windows Folder, This PC> Windows
These steps will stop the update services, type them line by line into the command prompt:
net stop wuauserv
net stop cryptSvc
net stop bits
net stop msiserver
Now you continue, by renaming the Software Distribution folder to "Software Distribution Old"
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
Now you go into the Windows Folder, and find the Folder called "Software Distribution Old" right click and "Delete"
Now you must restart the services one by one.
net start wuauserv
net start cryptSvc
net start bits
net start msiserver
Close CMD and restart the machine and your problems will be fixed; you can check for updates.
You cannot "install" a .wim (Windows Imaging) file, as it is a disk-based archive file used to deploy or repair Windows rather than an executable application. If you are trying to use a WIM file, you likely want to apply it as an operating system, extract/repair it, or convert an .esd file into a .wim
If you don´t know where windows are installed on your machine, then double click on "This PC" on desktop, and you will see a Windows Icon on the top of that disk, wherein Windows is installed.
- joecouchCopper Contributor
It could be a syntax issue. Try specifying the source as:
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:H:\Sources\install.wim:6 /LimitAccess
Also make sure the ISO/build version exactly matches the installed Windows version. A mismatch between the source image and your current build can cause the "source files could not be found" error.