Skip to content

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

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 returns could 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
    Batchfile
    findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfcdetails.txt"
    

Cleanup Windows Update#

  • analyze component store for removable updates

    Batchfile
    dism /Online /Cleanup-Image /AnalyzeComponentStore
    

  • trigger cleanup

    Batchfile
    dism /Online /Cleanup-Image /StartComponentCleanup
    

  • trigger more time consuming follow-up cleanup

    Batchfile
    dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase