Tag: dism

  • Restoring System Files

    If you’re having problems with your system that you think involves system files, you may need to restore your system files.

    The command everyone hears about, typically, is “sfc”. However, the problem with sfc is that it depends on a particular database of system files on your computer being kept up to date. Every technician encounters situations where sfc looks like it worked, but did absolutely nothing. That’s usually because the database needed to be updated. It does not seem to update automagically, unfortunately.

    The “other side of the coin” is the “dism” command.

    Here are two generic example uses of these commands (read here for more info from microsoft, or here for a nice video explanation by a 3rd party.)

    c:\windows\system32> sfc /scannow

    c:\windows\system32> DISM.exe /Online /Cleanup-image /Restorehealth

    A number of sample uses swiped from elsewhere …

    To check Windows image for issues (Doesn’t do repairs)

    c:\windows\system32> DISM /Online /Cleanup-Image /CheckHealth

    More advanced scan

    c:\windows\system32> DISM /Online /Cleanup-Image /ScanHealth

    Fix problems

    c:\windows\system32> DISM /Online /Cleanup-Image /RestoreHealth

    This might get stuck sometimes. Just wait for it to finish.

    Use offline image

    c:\windows\system32> DISM /Online /Cleanup-Image /RestoreHealth /Source:D:\Sources\install.esd

    to disable windows update in the scan add (/LimitAccess)

    SFC to just verify run

    c:\windows\system32> sfc /verifyonly

    To fix your system’s files run

    c:\windows\system32> SFC /scannow

    More discussion.

    The “fix problems” command above fixes the database, not the actual system files on your computer. You will still need to run an sfc /scannow command.

    The “use offline image” mode uses a database from another location, say your local network, or a usb-stick, etal..

    Adding “/limitaccess” to any of these commands prevents DISM from checking with Windows Updates for updated files. You may especially want to use this on a system that cannot reach microsoft’s update servers for some reason.

    For those of you less experienced, ignore the “c:\windows\system32>” part, that’s just meant to make it look more like a system prompt. Also you do not actually have to be in that particular folder in order to use either command.