How to use the SFC and DISM commands to repair Windows

Requirements

  • Windows 8 or newer
  • Windows Server 2012 or newer

Introduction

Any version of Windows, over time, may begin to exhibit abnormal behaviour: slowdowns, blue screens, applications that do not open or operating system functions that suddenly stop working. Corrupt or missing system files often cause these problems. To solve these problems, Windows integrates two powerful tools to diagnose and repair damaged components: SFC (System File Checker) and DISM (Deployment Image Servicing and Management). Using them can often solve many problems without having to reinstall the operating system.
In certain severe cases, system corruption may prevent these tools from restoring the components successfully.

What are SFC and DISM commands?

SFC – System File Checker

The SFC command performs a complete scan of protected Windows system files, and if it finds corrupt or missing files, it automatically replaces them with a corrected copy stored in the local cache.

DISM – Deployment Image Servicing and Management

The DISM command works at a deeper level than SFC. Administrators use it to manage and repair the Windows image used for installing or restoring system components. It becomes especially useful when the System File Checker fails. This usually happens because a corrupted system image prevents SFC from working properly.

How to run the DISM command

  1. Open the Windows Start menu and type cmd, right-click Command Prompt and select Run as administrator.
  2. In CMD type the following command and press ENTER:
    DISM.exe /Online /Cleanup-image /Scanhealth
    When finished, the status of the system image will be reported and whether there are any Windows components to restore;
  3. If there are any components that can be restored by the previous command, type the following command and press ENTER:
    DISM.exe /Online /Cleanup-image /Restorehealth
    At the end, a message will be displayed on the success of the operation and if it worked correctly, the Windows components have been restored.

How to run the SFC command

  1. Open the Windows Start menu and type cmd, right-click Command Prompt and select Run as administrator.
  2. In CMD type the following command and press ENTER:
    sfc /scannow
    When finished, you will see the status of your system files and whether they have been successfully restored.

Conclusion

After completing both procedures, Windows should restore its components and fix any errors in the system image. In the event that the operating system contains too many errors, it may happen that these tools are not able to remedy them and that it is therefore necessary to restore Windows.

By Giacomo

System Administrator. Founder and writer.