What is the purpose of the DISM
/RestoreHealth
parameter and the SFC
/ScanNow
parameter?
- How do they correlate to one another?
- In what order should they be run?
- Why does the order sequence matter when executing either?
dismsfcwindowswindows 10windows 8
What is the purpose of the DISM
/RestoreHealth
parameter and the SFC
/ScanNow
parameter?
Best Answer
The Component Store [
%WinDir%\WinSxS
] maintains a backup copy of all Windows system files;SFC
andDISM
manage two separate, vital pieces of the Component Store and OS, withSFC
relying entirely upon whatDISM
manages.DISM
has two functionsSFC
relies upon,/StartComponentCleanup
and/RestoreHealth
, with/RestoreHealth
relying 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 it's 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 corruptionDism
did not have this functionality until Windows 8SFC
always assumes the Component Store is not corrupted and is why theDISM
/RestoreHealth
parameter (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 comparisonDISM
andSFC
must be executed in the order listed, as each relies upon what the preceding does:(Windows 7: skip to #3)
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.install.esd
||install.wim
from the Windows Install ISO for the installed version (v1909, v2004, etc.):install.esd
||install.wim
:/Source
parameter:%WinDir%\Logs\DISM\dism.log
from the bottom up(Log files are easier to read and sift through via the Log syntax in VS Code)
%WinDir%\Logs\DISM\dism.log
%WinDir%\Logs\CBS\CheckSUR.log
(How to fix SUR errors)%WinDir%\Logs\CBS\CBS.log
from the bottom upI run these weekly via Task Scheduler to help prevent random issues from occurring:
Dism_ComponentCleanup.xml
Executes weekly on Sundays at 11:30:00
Dism_RestoreHealth.xml
Executes weekly on Sundays at 12:00:00
Sfc_ScanNow.xml
Executes weekly on Sundays at 13:00:00
To import into Task Scheduler:
TaskSchd.msc
Custom
<task_name>.xml
Cmd
:Powershell
: