Repairing Corrupt Windows System Files

System File Checker and DISM Commands

Windows provides built-in tools for diagnosing and repairing system corruption.
System File Checker (SFC) validates and repairs protected system files, while Deployment Image Servicing and Management (DISM) analyzes and restores the Windows component store.
These commands are commonly used during troubleshooting to resolve issues such as corrupted services, damaged system files, or failed updates.


SFC Command

sfc /scannow scans all protected system files and automatically repairs corrupted files using the Windows component store.

Available SFC Commands and Switches

  • sfc /scannow – Scans system files and repairs damaged components.
  • sfc /verifyonly – Scans system files without performing repairs.
  • sfc /scanfile=<file> – Scans and repairs a specific file.
  • sfc /verifyfile=<file> – Verifies a specific file without repairing it.
  • sfc /offbootdir=<path> – Specifies the offline boot directory.
  • sfc /offwindir=<path> – Specifies the offline Windows directory.

DISM Image Health Commands

DISM provides deeper repair capabilities by working directly with the Windows image. These commands are used when SFC cannot repair system files or when the component store itself is damaged.

Note: The component store is an internal part of Windows that stores every system file, feature, update, and repair source the operating system needs to function correctly. It lives inside the WinSxS folder (C:\Windows\WinSxS) and acts as Windows’ master library for protected components.

Primary DISM Commands

  • DISM /Online /Cleanup-Image /CheckHealth – Checks whether the component store is flagged as corrupted.
  • DISM /Online /Cleanup-Image /ScanHealth – Performs a detailed scan for corruption.
  • DISM /Online /Cleanup-Image /RestoreHealth – Repairs the component store using Windows Update or a specified source.

DISM Cleanup and Repair Switches

  • /Online – Targets the running operating system.
  • /Image:<path> – Targets an offline Windows image.
  • /Cleanup-Image – Enables image cleanup and repair mode.
  • /CheckHealth – Performs a quick scan for known corruption.
  • /ScanHealth – Performs a full corruption scan.
  • /RestoreHealth – Repairs component store corruption.
  • /Source:<path> – Specifies a repair source such as a WIM or ESD file.
  • /LimitAccess – Prevents DISM from using Windows Update during repair.

Examples of Repair Sources

  • /Source:WIM:D:\sources\install.wim:1
  • /Source:ESD:D:\sources\install.esd:1

This reference is ideal when diagnosing system corruption, repairing Windows services, or preparing systems for deployment.

Leave a Reply