How to Use the Windows DISM and SFC Commands to Repair System Files

When a Windows machine begins exhibiting bizarre behaviour—such as the Start menu refusing to open, random applications crashing instantly upon launch, or Windows Updates failing with cryptic error codes—the underlying cause is almost always corrupted core system files. While many users instinctively turn to third-party “PC Optimizer” software or contemplate a stressful total system reset, Windows actually possesses a deeply integrated, highly potent repair mechanism. By learning how to use the Windows DISM and SFC commands, you can instruct the operating system to automatically scan its own architecture, identify damaged code, and pull fresh replacement files directly from Microsoft’s servers.

In this advanced system administration guide, we will bypass the graphical interface and step into the command line. We will explain the critical difference between these two utilities, why they must be executed in a specific order, and provide the exact syntax required to repair a severely degraded Windows installation.

Understanding the Two Repair Tools

To successfully repair Windows, you must use two distinct command-line utilities in tandem. Using one without the other often results in failure.

1. SFC (System File Checker)

The SFC utility is the inspector. Its job is to scan all protected Windows system files and compare them against a known, healthy baseline. If it finds a file that has been modified, corrupted, or deleted (perhaps by malware or a bad software uninstaller), it attempts to replace that specific file with a cached copy stored locally on your hard drive.

2. DISM (Deployment Image Servicing and Management)

The DISM utility is the supplier. What happens if the local cache that SFC relies on is also corrupted? The SFC scan will fail. DISM connects directly to Windows Update servers over the internet to download completely fresh, uncorrupted image files to repair your local cache.

The Golden Rule: You must always run DISM first to repair the local cache, and then run SFC to utilise that repaired cache to fix the actual operating system.

Step 1: Opening an Elevated Command Prompt

Because these commands modify the core operating system, they cannot be run from a standard user terminal. You must grant the terminal administrator privileges.

  1. Click the Start button (or press the Windows key).
  2. Type cmd into the search bar.
  3. You will see “Command Prompt” appear in the results. In the right-hand panel, click Run as administrator.
  4. A User Account Control (UAC) prompt will appear asking if you want to allow the app to make changes. Click Yes.
  5. A black terminal window will open. The path should read C:\Windows\System32>. If it says C:\Users\YourName>, you did not open it as an administrator and the commands will fail.

Step 2: Running the DISM Repair Command

Ensure your computer is connected to the internet before proceeding, as DISM needs to communicate with Microsoft.

  1. In the black terminal window, carefully type (or copy and paste) the following command exactly as it appears, including the spaces:
    DISM /Online /Cleanup-Image /RestoreHealth
  2. Press Enter.

The terminal will display “Deployment Image Servicing and Management tool” and a progress bar will eventually appear. This scan is heavily reliant on your internet speed and hard drive performance. It is incredibly common for the progress bar to appear “stuck” at 20% or 40% for several minutes. Do not close the window or restart your computer. Allow it to finish.

Once it reaches 100%, it will display a message stating, “The restore operation completed successfully.” Your local repair cache is now pristine.

Step 3: Running the SFC Scan

Now that DISM has guaranteed the integrity of your backup files, you can deploy the inspector to actually fix the operating system.

  1. In the exact same terminal window, type the following command:
    sfc /scannow
  2. Press Enter.

The message “Beginning system scan. This process will take some time” will appear, followed by a percentage tracker.

Step 4: Interpreting the SFC Results

When the SFC scan hits 100%, it will output one of four specific messages. Understanding these results dictates your next steps:

  • “Windows Resource Protection did not find any integrity violations.”
    Your core operating system files are perfect. If you are still experiencing crashes, the issue is likely a failing hardware component (like bad RAM) or a third-party application, not Windows itself.
  • “Windows Resource Protection found corrupt files and successfully repaired them.”
    Success! The tool identified the corruption and fixed it using the cache we repaired with DISM. Restart your computer immediately to apply the fixes.
  • “Windows Resource Protection found corrupt files but was unable to fix some of them.”
    This is rare but indicates severe corruption that even DISM could not bypass. You will likely need to perform a “Reset this PC” operation from the Windows Settings menu, opting to keep your personal files.
  • “Windows Resource Protection could not perform the requested operation.”
    A background service is actively blocking the repair tool. Restart your computer into Windows Safe Mode and attempt the exact same commands again.

Operating system degradation is a frustrating reality of daily PC usage, but it does not require drastic measures to resolve. By understanding the relationship between the Windows DISM and SFC commands, you possess the administrative knowledge required to surgically repair severe software corruption, saving yourself the monumental hassle of a complete system format.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.