Windows System Repair Guide P2 “DISM and SFC”

This document is created for Windows 10 22H2 and Windows 11 24H2 versions, primarily based on Windows 10 22H2

During usage, you may encounter issues such as blue screens, crashes, and other system problems that affect normal use. In most cases, you can use Windows’ built-in repair functions to fix them. Below are repair solutions for different environments.

If the solutions do not resolve the issue, you can visit the Microsoft Community to post questions and seek assistance.

DISM and SFC

Introduction

DISM

Deployment Imaging Service and Management (DISM) is a command-line tool used to service Windows images. You can use DISM image management commands to load and retrieve information about Windows image (.wim) files, Full-Flash Utility files, or virtual hard disks (VHDs). DISM can also be used to capture, split, and otherwise manage .wim files.
You can use DISM service commands to install, uninstall, configure, and update Windows features, packages, drivers, and international settings in .wim files, .ffu files, or VHDs.
DISM commands can be used for offline images, and some DISM commands can also be used for the running operating system.
DISM is installed with Windows and is also distributed in the Windows Assessment and Deployment Kit (Windows ADK). It replaces several deployment tools, including PEimg, Intlcfg, ImageX, and Package Manager. [1]

From a system repair perspective, DISM scans the WinSxS folder over the network to check for abnormalities and repair them. The WinSxS folder, fully known as the Windows Side-by-Side folder, is a core component of the Windows operating system. Its primary functions include:

  • Component Storage: WinSxS is the component store of Windows, containing all files and components needed for the system to operate. It stores everything from essential system files, system updates, patches, to files for installing new features.
  • Support for System Updates and Repairs: When the system needs to install updates, repair corrupted system files, or roll back to previous component versions, WinSxS provides the necessary file support. For example, when using DISM or SFC to repair the system, they retrieve the required files from WinSxS.
  • Achieving Version Coexistence: To avoid compatibility issues due to updates, the WinSxS folder allows multiple versions of the same component to coexist. This ensures that even if a component update causes problems, the system or specific programs can still call the old version.

SFC

Scans and verifies the integrity of all protected system files and replaces incorrect versions with the correct ones. If this command finds protected files that have been overwritten, it retrieves the correct version of the file from the systemroot\ folder and replaces the incorrect file. [2]

SFC stands for “System File Checker.” It is a tool in Windows used to scan and repair damaged or missing system files. By running the SFC command, users can automatically fix errors in system files that might cause system instability or application crashes.

Differences Between the Two

  • DISM: Used for repairing and maintaining Windows images (e.g., the operating system installation image). It can fix underlying issues in the system, including damaged Windows system files, drivers, etc., and can even repair system images while Windows is in a normal boot state.
  • SFC: Primarily used to scan and repair damaged or missing files in the Windows system, especially critical system files. It uses a file called sfc.dll to check and fix corrupted system files, such as .dll and .exe files.

Generally, DISM repairs are more comprehensive than SFC repairs. However, it is still recommended to run SFC after DISM, one important reason being that SFC depends on a healthy image, and DISM can detect and repair abnormal images. You can also directly use SFC to scan and repair without using DISM first.

How to Operate

Open PowerShell

  1. Right-click the Windows logo or press Win + X keys and click Command Prompt (Administrator) [Windows 10]
    Right-click the Windows logo or press Win + X keys and click Windows Terminal (Administrator) [Windows 11]
  2. Search for PowerShell in the search bar and select Run as Administrator
  3. Press Win + R keys, type PowerShell, press Enter, and then press Ctrl + Shift + Enter or type Start-Process PowerShell -Verb RunAs and press Enter

Note: The command should be executed in a PowerShell window with administrator privileges.

DISM

Command operations:

  1. First, enter DISM /Online /Cleanup-Image /CheckHealth and press Enter
    Purpose: Check if the Windows image has been flagged as corrupted.
  2. After the previous command finishes, enter DISM /Online /Cleanup-Image /ScanHealth and press Enter
    Purpose: Perform a thorough scan of the image to determine if there is any corruption in the component store.
  3. After the previous command completes, enter DISM /Online /Cleanup-Image /RestoreHealth and press Enter
    Purpose: Attempt to repair the corrupted parts of the Windows image once issues are detected.
    • You can also use DISM /Online /Cleanup-Image /RestoreHealth /Source:"D:\Sources\install.wim:1" /LimitAccess to specify the source of repair files.

These solutions are for when the system is connected to the internet. If your computer is offline, you can try using an offline image for repair. You will need an offline image file for this operation.

Command operations for offline repair:

  1. First, ensure the location of the offline image.
  2. Enter DISM /Mount-WIM /WimFile:"C:\\{Path}\\{name}.wim" /MountDir:"C:\Mount" and press Enter
    Purpose: Mount the image.
  3. Enter DISM /Image:"C:\Mount" /Cleanup-Image /RestoreHealth and press Enter
    Purpose: Perform repairs or add packages to the mounted image.
  4. Enter DISM /Unmount-WIM /MountDir:"C:\Mount" /Commit and press Enter
    Purpose: Unmount the image and save the changes.

After completing the above steps, you can proceed with SFC scanning or simply restart the computer.

SFC

Command operation:

  1. Enter sfc /scan now and press Enter

Once the operation completes, restart the computer directly.


[1] “DISM - Deployment Image Servicing and Management”. Windows Learn. 23 Feb 2025
[2] “Windows Commands”. Windows Learn. 24 Feb 2025