(cache)Use DISM to fix issues SFC can't - gHacks Tech News

Use DISM to fix issues SFC can't

A common suggestion on Windows support forums is to scan the system for file integrity issues using the command sfc /scannow which you may run on the active system but also on external drives.

SFC, which stands for System File Checker, is a built-in administrative tool to verify the integrity of operating system files and to repair files that are corrupt, damaged or changed.

SFC scans have three possible outcomes:

  1. The scan did not find any issues.
  2. The scan did find issues and fixed them.
  3. The scan did find issues and couldn't repair them (Windows Resource Protection found corrupt files but was unable to fix some of them).

Note: It is recommended that you do a full backup of the Windows system partition before you run DISM. Use free backup solutions such as Macrium Reflect, Veeam Endpoint Backup, or other backup tools.

Use DISM if SFC /Scannow fails to correct issues

sfc scannow

The screenshot displayed above shows a result where SFC was unable to correct corrupt files that it detected.

SFC may also correct issues but it may not resolve the issue that you tried to correct in first place by running it.

DISM comes to the rescue in these situations. Deployment Image Servicing and Management (DISM)  is a command line program for Windows that is used for a variety of purposes.It is available in all versions of Windows starting with Windows 7 and Windows Server 2008

You need to run DISM from an elevated command prompt:

  1. Tap on the Windows-key to bring up the start menu.
  2. Type cmd.exe and wait for the results to populate.
  3. Right-click on the result named cmd.exe and select "run as administrator" to run it with elevated privileges.

DISM can be run in dry-mode to reveal corruption without attempting to fix issues found. I recommend that you check the health first to find out if corruption exists before you run repair operations.

Dism /Online /Cleanup-Image /CheckHealth

dism checkhealth

The command checks the image for the corruption flag and returns its findings to you but does not run repair operations.

The scan should not take longer than a second or two. Previous operations may have flagged the image as corrupt.

Dism /Online /Cleanup-Image /ScanHealth

dism scanhealth

The command scans for component store corruption but does not correct any issues.

The scan takes longer to complete and the findings of the scan are returned in the command prompt window.

DISM /Online /Cleanup-Image /RestoreHealth

dism restorehealth

The /RestoreHealth parameter runs a scan for corruption and attempts to repair any issues that it finds automatically.

The scan takes longer to complete if corruption is found during the scan of the image. Note that the operation may appear stuck at times but this is no cause for concern as scanning should commence after a moment automatically.

If the scan finds corruption, it attempts to correct the issue using Windows Update by default.

DISM Advanced commands

  • To repair an offline image: Dism /Image:C:\offline /Cleanup-Image /RestoreHealth
  • To use a different repair source: Dism /Online /Cleanup-Image /RestoreHealth /Source:d:\test\mount\windows
  • To prevent the use of Windows Update:  /LimitAccess as a parameter.

Group Policy

You can specify a different source using the Group Policy.

dism repair policy

Do the following for that:

  1. Tap on the Windows-key to bring up the start menu.
  2. Type gpedit.msc and hit the Enter-key to open the Group Policy Editor. Note that it is only available in professional or Enterprise editions of Windows.
  3. Go to Computer Configuration > Administrative Templates > System.
  4. Double-click on Specify settings for optional component installation and component repair.
  5. Set the policy to enabled, and configure it accordingly.
  6. You need to specify an alternate source, and may block use of Windows Update. Systems configured to use WSUS by default may be configured to use Windows Update instead for repair operations.

Dism using PowerShell

You may use DISM in Windows PowerShell as well. The commands are slightly different.

  • CheckHealth: Repair-WindowsImage -CheckHealth
  • ScanHealth: Repair-WindowsImage -ScanHealth
  • RestoreHealth: Repair-WindowsImage -RestoreHealth

DISM Instructional Video

Related articles

Summary
Use DISM to fix issues SFC can't
Article Name
Use DISM to fix issues SFC can't
Description
How to use the DISM command line tool to repair Windows operating system issues if SFC /scannow does not resolve them.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:


Previous Post: «
Next Post: »

Comments

  1. Franck said on March 16, 2018 at 11:25 am
    Reply

    Thanks a lot for the info ! There is a great app with GUI : Dism++

  2. cic said on March 16, 2018 at 1:30 pm
    Reply

    Although Dism command exists on Windows7 it doesn’t work with those options, maybe someone could explains how to repair on Win7?

    1. B0BoB said on March 16, 2018 at 1:44 pm
      Reply

      Simple, Use DISM++

      1. Jody Thornton said on March 16, 2018 at 3:45 pm
        Reply

        Yes but DISM++ is limited by the capabilities of the OS. I’ve tried removing superseded components on Windows 8 (the same as you can with Windows 8.1), but it won’t perform tasks that the OS version can’t support.

      2. ilev said on March 19, 2018 at 8:33 pm
        Reply

        DISM++ in no more than a CCleaner and can’t perform any of DISM features.

    2. Mike said on March 20, 2018 at 11:58 am
      Reply

      Download Windows ADK to get an up-to-date DISM tool:
      https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install

      Please note some DISM repair options are not available on older OS (ie Win7), it won’t harm your OS though :)

  3. Mark Hazard said on March 16, 2018 at 2:14 pm
    Reply

    Thanks for the article Martin. I wondered what DISM was for.

  4. Andy said on March 16, 2018 at 4:25 pm
    Reply

    Great article. Sfc is almost useless now days it seems. I will remember to try this mor often.

  5. Microfix said on March 17, 2018 at 1:10 pm
    Reply

    Martin,
    SFC stands for System File Checker not ‘System File Scan’ as per the article description. One point deducted from each reader who never noticed and one from the author :)

    I prefer to use:
    sfc/ verifyonly
    prior to using the scannow switch.
    (which notifies the user of errors but, does not correct them, so I can investigate further.)

    1. Martin Brinkmann said on March 17, 2018 at 4:35 pm
      Reply

      You are right of course, sorry for that. Fixed it!

      1. Microfix said on March 17, 2018 at 4:56 pm
        Reply

        Nice to keep things correct to uphold your reputation.
        Many thanks for the article :)

  6. OldNavyGuy said on March 20, 2018 at 1:51 am
    Reply

    Sysnative’s SFCFix is a good alternative, and fixes some things SFC and DISM cannot…

    https://www.sysnative.com/forums/windows-update/4736-windows-update-forum-posting-instructions.html

    Expand Step 4 for the download link.

  7. Sam said on October 24, 2018 at 4:28 am
    Reply

    Hello,

    Is it possible to schedule SFC & DISM tasks to be performed on a regular basis as a preventative way? How is ADK compare to SFC/DISM ?

    Thank you

  8. Yash Makwana said on November 6, 2018 at 3:59 pm
    Reply

    i got a problem as error 1117 while dism scan health comand

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.