Windows Image Repair#
DISM: Repair Windows Update corruptions#
dism: repair system image using Windows Update to restore ucorrupted files
- scan but not repair corruptions
Batchfile
dism /Online /Cleanup-Image /CheckHealth
- more advanced scan
Batchfile
dism /Online /Cleanup-Image /ScanHealth
- scan and repair common issues
Batchfile
dism /Online /Cleanup-Image /RestoreHealth
- use mounted installation media/iso to restore system files
Batchfile
dism /Online /Cleanup-Image /RestoreHealth /Source:F:\sources\Install.esd /LimitAccess
-
%windir%\Logs\DISM\dism.log
: generated detailed log -
more details at Fix Windows Update errors by using the DISM or System Update Readiness tool
System File Checker: Repair Protected Operating System Files#
System File Checker: scan/repair all protected system files using the local image files at %windir%\System32\dllcache
Batchfile
sfc /scannow
- if
sfc
returnscould not perform the requested operation
- ensure folders exist
%windir%\WinSxS\Temp\PendingDeletes
,%windir%\WinSxS\Temp\PendingRenames
- reboot into safe mode and rerun
sfc
%windir%\Logs\CBS\CBS.log
: generated detailed log; extract sfc process details only with
Batchfilefindstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfcdetails.txt"
Cleanup Windows Update#
-
analyze component store for removable updates
Batchfiledism /Online /Cleanup-Image /AnalyzeComponentStore
-
trigger cleanup
Batchfiledism /Online /Cleanup-Image /StartComponentCleanup
-
trigger more time consuming follow-up cleanup
Batchfiledism /Online /Cleanup-Image /StartComponentCleanup /ResetBase