All commands require an admin CMD or Powershell

Note: DISM should be used to repair the OS files before using SFC to repair the OS.

Using SFC

SFC is a basic command to check and repair minor OS corruption.

In CMD or Powershell run:

sfc /scannow

Using DISM without a source

DISM is a larger command, that can do much more to repair broken parts of an OS.

In CMD or Powershell run:
  1. To check for issues

    DISM /Online /Cleanup-Image /CheckHealth

  2. To check for deeper issues

    DISM /Online /Cleanup-Image /ScanHealth

  3. To resolve issues

    DISM /Online /Cleanup-Image /RestoreHealth

Using DISM with a source WIM (from an ISO)

DISM normally uses an Online source to repair your system, sometimes this leads to errors. You can use a Windows 10 ISO to get a 'clean' source locally. Download the ISO using the Windows media creation tool

Double click the downloaded ISO to mount it and note its drive letter in 'This PC'

In CMD or Powershell run:
  1. Repair issues with your local source

    DISM /Online /Cleanup-Image /RestoreHealth /Source:F:\Sources\install.wim

Using Indices

For Windows server you may need to look into using a specifc index of the WIM

  1. Check a WIMs indices with

    • Powershell Get-WindowsImage -ImagePath F:\sources\install.wim
    • CMD dism /Get-WimInfo /WimFile:F:\sources\install.wim
  2. Use the index to run a repair against your specific OS type

    DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:F:\Sources\install.wim:1

Revision #8
Created 8 January 2021 14:12:00 by PipeItToDevNull
Updated 15 May 2022 12:55:09 by Willzy12h