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?
1 Reply
- 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.