I have two computers (win10x64 and win7x86) that completely freeze from time to time (black screen), and the only solution is to unplug them.
If I use DISM /Online /Cleanup-Image /RestoreHealth, how will it affect the currently installed software, or any windows configuration I might have changed. Will I need to start over ?
3 Answers
Will I need to start over?
No, please see the below.
If I use
Dism /Online /Cleanup-Image /RestoreHealth, how will it affect the currently installed software or any Windows configuration I might have changed?
It doesn't affect any installed software, as /Cleanup-Image deals with the Windows Component Store, not third-party programs, nor any customizations made to the OS:
- The Component Store [
%WinDir%\WinSxS] maintains a backup copy of all Windows system files andSFCandDISMmanage two separate, vital pieces of the Component Store and OS, withSFCrelying entirely upon whatDISMmanages:DISMhas two functionsSFCrelies upon,/StartComponentCleanupand/RestoreHealth, with/RestoreHealthrelying solely upon/StartComponentCleanup/StartComponentCleanup: Cleans the Component Store of any broken hard links
It's imperative folks on Insider Builds run this regularly due to the frequent updates/RestoreHealth: Verifies and fixes any corruption in the Component Store by verifying its system file backups against known good copies from the Windows Update servers through hash comparison; while an offline method does exist [below], it may not always fix the corruption- Windows 7: SUR [System Update Readiness] tool is used in lieu of this, as
DISMdid not have this functionality until Windows 8
- Windows 7: SUR [System Update Readiness] tool is used in lieu of this, as
SFCalways assumes the Component Store is not corrupted and is why theDISM/RestoreHealthparameter (Windows 7: SUR) should always be run prior toSFC; not doing so allows a corrupted Component Store to potentially replace a good system file with a corrupted one or fail to fix corruption within%WinDir%altogether/ScanNow: Verifies and fixes any corruption within%WinDir%by verifying against the known good copies within the Component Store through hash comparison
DISMandSFCmust be executed in the order listed, as each relies upon the preceding step:
(Windows 7: skip to #3)+R → Open:
PowerShell→ Ctrl+Shift+OK
The Component Store should always be cleaned prior to running Windows Update, after an issue with Windows Update, and at least once a month, as it becomes dirty over time from updates occasionally breaking hard links# Windows ≥8: # Online (while booted to Windows): Dism /Online /Cleanup-Image /StartComponentCleanup # Offline (while booted to WinPE/WinRE): Dism /Image:"D:\Windows" /Cleanup-Image /StartComponentCleanup # C: is usually not the drive letter in WinPE/WinRE # To ascertain: DiskPart → Lis Vol → Exit
Requires an internet connection, else the offline method will be required:# Windows ≥8: # Online (while booted to Windows): Dism /Online /Cleanup-Image /RestoreHealth # Offline (while booted to WinPE/WinRE): Dism /Image:"D:\Windows" /Cleanup-Image /RestoreHealth- Use the
install.esd||install.wimfrom the Windows Install ISO for the installed version (v1909, v2004, etc.):- Create Windows 10 installation media → Download tool now → install on another PC
- Mount the ISO and determine the installed OS index [image] from the
install.esd||install.wim:Dism /Get-ImageInfo /ImageFile:"Z:\sources\install.esd" - Specify the index number at the end of the
/Sourceparameter:# Online (while booted to Windows): # ESD: Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:"Z:\sources\install.esd":6 /LimitAccess # WIM: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:"Z:\sources\install.wim":6 /LimitAccess # Offline (while booted to WinPE/WinRE): Dism /Image:"D:\Windows" /Cleanup-Image /RestoreHealth /Source:esd:"Z:\sources\install.esd":6 /LimitAccess
- Use the
- Windows 7: Run the SUR tool
- Reboot; if errors are found, review
%WinDir%\Logs\DISM\dism.logfrom the bottom up
(Log files are easier to read and sift through via the Log syntax in VS Code)- Windows ≥8:
%WinDir%\Logs\DISM\dism.log - Windows 7:
%WinDir%\Logs\CBS\CheckSUR.log(How to fix SUR errors)
- Windows ≥8:
# Online (while booted to Windows): Sfc /ScanNow # Offline (while booted to WinPE/WinRE): Sfc /ScanNow /OffBootDir=D:\ /OffWinDir=D:\Windows # C: is usually not the drive letter in WinPE/WinRE # To ascertain: DiskPart → Lis Vol → Exit- Reboot; if errors are found, review
%WinDir%\Logs\CBS\CBS.logfrom the bottom up
Run firstsfc /scannow before doing DISM.
Theoretically, your configuration should not be affected by either of these commands. But in case of advanced degradation of your system, the repair itself might cause further damage. The chances for that are very slim, but do not skimp on backups before starting.
I suggest having a look at this answerof mine.
6Dism /Online /Cleanup-Image /RestoreHealth
and /or
sfc /scannow
Both will restore modified & corrupted system files. So, you can lose your overzealous windows customizations. Ideally, it should not change non-Microsoft programs & settings, still depending on the level of corruption!
- If you are so concerned about your customizations, You can just run scans
sfc /verifyonly
and /or
Dism /Online /Cleanup-Image /ScanHealth
They will just check the files without any repair process ( as here & here ). Analyze the log/ report & decide.
- DISM /Online /Cleanup-Image /RestoreHealth
is not available for win 7. ( DISM commands are very limited on win 7)
- & You can always make System Image ( Macrium Reflect ) before that!