Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Using DISM and SFC to Check and Repair Windows System Files

August 24, 2026

Using DISM and SFC to Check and Repair Windows System Files

To check the integrity of Windows system files and component libraries and repair any corruption, you can use the built-in SFC(System File Checker) and DISM (Deployment Image Servicing and Management) tools in Windows and Windows Server. These tools can be extremely useful when the operating system becomes unstable, errors occur when trying to run built-in apps or services, or after malware attacks.

In this article, we will look at how to use the sfc /scannow, DISM /Online /Cleanup-Image /RestoreHealth, and Repair-WindowsImage -Online -RestoreHealth commands to repair the Windows component store (Windows image) and corrupted system files in Windows 11 and 10, as well as Windows Server 2025, 2022, 2019, and 2016.

Contents:
  • DISM and SFC: Proper Windows Repair Procedure
  • Check Windows Component Store Health Using DISM
  • Repair Windows Image Using DISM /RestoreHealth
  • How to Use an Offline Windows Image (ISO, WIM) as a DISM Repair Source
  • Repair Windows Image and System Files with PowerShell
  • How to Use DISM Offline to Repair a Windows Image
  • SFC /ScanNow: Repair Corrupted Windows System Files

DISM and SFC: Proper Windows Repair Procedure

The main command for scanning and repairing the Windows component store is:

DISM /Online /Cleanup-Image /RestoreHealth

This command scans the Windows component store (the WinSxS directory) and detects corrupted component files by comparing the actual SHA-256 hashes of binary files with the reference values stored in their manifests. If necessary, DISM downloads the original component files from the Windows Update servers over the Internet and uses them to replace the corrupted files.

The next important command is:

sfc /scannow

This command verifies the integrity of the protected system files currently in use. If a file is missing or its hash does not match the expected value, SFC replaces it with the corresponding version from the WinSxS component store, which serves as the reference source.

More detailed information about using DISM and SFC to repair Windows image system files is provided in the following sections of this article.

In other words, the SFC /SCANNOW relies on the Windows component store as its source for replacement files. Therefore, you should run DISM first, so that the reference files in the component store are in a healthy state before running SFC.

Before attempting to repair system files with SFC, run DISM first and make sure that the Windows component store is healthy.

Check Windows Component Store Health Using DISM

The built-in DISM (Deployment Image Servicing and Management) tool in Windows is used to service, prepare, modify, and repair Windows images.

To service the Windows component store, use the DISM /Cleanup-Image option together with one of the following arguments:

  • /CheckHealth – performs a quick check for existing component store corruption flags. It typically takes only a few seconds.
  • /ScanHealth – performs a full scan of the component store without attempting to repair any detected corruption. This takes up to 30 minutes.
  • /RestoreHealth – performs a comprehensive health check of the Windows component store and automatically repairs any corruption it detects. This operation can take considerably longer.

To check whether the Windows image has been marked as corrupted by the CBS (Component-Based Servicing) subsystem, open an elevated command prompt and run:

DISM /Online /Cleanup-Image /CheckHealth

As mentioned earlier, this command doesn’t perform a full scan of the component store.  The command only checks if your Windows image is marked by the CBS flag as corrupted and if it is possible to fix it. No changes are made to the image. The command checks whether the Windows image is currently marked as corrupted and whether the detected corruption can potentially be repaired.

DISM /Cleanup-Image /CheckHealth - check windows 10 image

In this example, the command has returned that the Windows image has no corruption:

No component store corruption detected.
The operation completed successfully.

To run a full health check scan against the Windows Component Store, run the command:

DISM /Online /Cleanup-Image /ScanHealth

Checking the Windows image can take quite a long time (10-30 minutes). It will return one of three results:

  • No component store corruption detected – DISM found no errors in the component store
  • The component store is repairable – DISM has found errors in the Component Store and can fix them
  • The component store is not repairable – DISM cannot fix the Windows Component Store (try using a newer version of DISM or you will have to restore a Windows image from a backup, reset or completely reinstall your Windows instance).

dism: component store is repairable

You can review errors detected by DISM in the component store in the following text log file C:\Windows\Logs\CBS\CBS.log .

Before proceeding, make sure that the computer is not pending a reboot after adding or removing a Windows component/role or installing updates. If the system is in a Pending Restart state, DISM will always return the following status:

The component store is repairable.

dism cleanup image while pending reboot

To use the DISM /ScanHealth option on Windows 7 and Windows Server 2008, you have to install the KB2966583 update. Otherwise, you will see the message: “Error 87. The ScanHealth option is not recognized in this context”.

In some cases, the DISM /ScanHealth returns the following errors:

  • DISM Error 1726 – “The remote procedure call failed”
  • DISM Error 1910 – “The object exporter specified was not found”

It definitely means that your Windows image is corrupted and needs to be repaired.

Repair Windows Image Using DISM /RestoreHealth

To repair corruption in the Windows image Component Store, use the RestoreHealth option of the DISM command. This option instructs DISM to find missing or corrupted files in the component store and automatically download and replace them with known-good versions obtained from Windows Update (the computer must have Internet access). Run the command:

DISM /Online /Cleanup-Image /RestoreHealth

In Windows 7/2008 R2, this command looks different:
DISM.exe /Online /Cleanup-Image /ScanHealth  

The process of scanning and repairing the Component Store may take quite a long time (30 minutes or more). DISM will automatically download and replace the files of corrupted or missing components with original file versions from Windows Update.

If the repair has been successful, the following message will appear:

The restore operation completed successfully.

DISM /Online /Cleanup-Image /RestoreHealth - The restore operation completed successfully

How to Use an Offline Windows Image (ISO, WIM) as a DISM Repair Source

If your computer (server) has no direct Internet access (located behind a proxy, or connected to an internal WSUS update server to get security and build updates) or the Windows Update service is disabled/ corrupted (how to repair Windows Update client), DISM may return errors when attempting to repair the component store:

  • 0x800f0906 – The source files could not be downloaded. Use the Source option to specify the location of the files that are required to restore the feature;
  • 0x800f0950 – DISM failed. No operation was performed;
  • 0x800F081F – The source files could not be found. Use the Source option to specify the location of the files that are required to restore the feature.

dism error 0x800F081F - The source files could not be found. Use the “Source” option to specify the location of the files that are required to restore the feature

If your network uses a proxy server for Internet access, you need to configure the WinHTTP system proxy settings, because DISM doesn’t use the current user’s proxy settings.

In all of these cases, you can use an alternative source to get the original Component Store files. Possible sources include:

  • A bootable USB flash drive or ISO image containing the Windows installation media
  • A mounted install.wim file from the Windows installation image
  • The \sources\SxS directory on the Windows installation media

The DISM command allows you to specify an offline WIM or ESD file from the original Windows installation image to be used as the source to repair the system files in the Windows component store. For example, assume that you have mounted a Windows installation ISO image as a virtual drive D:.

Note. To repair the corrupted files in the Component Store from a local source, the Windows build and edition in the WIM/ESD image must match those of your system.

Check which Windows version and build is installed on your computer using the following PowerShell command:

Get-ComputerInfo |select WindowsProductName,WindowsEditionId,WindowsVersion, OSDisplayVersion

powershell: get current windows edition and version

List the editions of Windows available in the installation WIM image:

Get-WindowsImage -ImagePath "D:\sources\install.wim"

In our case, the Windows 11 Pro image in the install.wim file has ImageIndex = 6.

powershell: get-windowsimage index number

To repair the Component Store from a local WIM/ESD file using the local source files (without using Windows Update online services), run the following command (remember to specify the Windows version index in the image file):

DISM /online /cleanup-image /restorehealth /source:WIM:D:\sources\install.wim:6 /limitaccess
or:
DISM /online /cleanup-image /restorehealth /source:ESD:D:\sources\install.esd:6 /limitaccess

 Please note that the path to the WIM/ESD file specified in the DISM command is case-sensitive. Otherwise, you will receive DISM Error 2 – The system cannot find the file specified . 

dism /clenup-image /restorehealth command in windows 11

The following errors can appear when running the DISM /RestoreHealth command:

  • Error: 50: DISM does not support servicing Windows PE with the /Online option – this means that DISM thinks you are trying to repair a WinPE image. To fix this, remove the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MiniNT;
  • DISM Error 87: make sure the DISM command is written correctly, and make sure you are using the DISM version for your Windows version (usually when booting in WinPE/ WinRE).
  • 0x80073701 The referenced assembly could not be found error while trying to install Windows roles or features. DISM is unable to repair the issue, so you may need to manually fix the Windows component store configuration in the registry.
  • 0x800f0915 – The repair content could not be found anywhere. Check the Internet connectivity or use the /Source option to specify the location of the files required to restore the Windows image. To resolve this issue, run: DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBaseThen clear the Windows Update cache (C:\Windows\SoftwareDistribution), Reset the Windows Update configuration using the Reset Windows Update Tool (wureset), reboot the computer, and run the DISM repair again.

Repair Windows Image and System Files with PowerShell

Instead of using the DISM command to check and repair the Windows Component Store, you can use the equivalent PowerShell cmdlet,Repair-WindowsImage, which is available in Windows 10/11 and Windows Server 2025, 2022, and 2019. Run this command to scan the Windows component store and find any corruptions:

Repair-WindowsImage -Online –ScanHealth

Repair-WindowsImage -Online –ScanHealth powershell

If no errors are found in the Component Store, the following message appears:

ImageHealth State: Healthy

To repair the component store in the Windows image and system files, run the command:

Repair-WindowsImage -Online -RestoreHealth

If the computer doesn’t have Internet access, this command may hang during the image repairing process. You can instead restore the system components store from an offline Windows image file (install.wim or install.esd), which can be copied from a Windows Installation ISO. In this case, you also need to specify the Windows edition index within the WIM/ESD file as the repair source:

Repair-WindowsImage -Online -RestoreHealth -Source F:\sources\install.wim:5 -LimitAccess

How to Use DISM Offline to Repair a Windows Image

If Windows won’t boot at all, you can use DISM to check and repair system files offline by booting your computer into the Windows Recovery Environment (WinRE) or from an installation USB flash drive.

  1. Boot your device from the Windows installation image (you can use the Media Creation Tool to create a bootable Windows USB stick) and press Shift + F10 on the initial Windows Setup screen.
  2. To find out which drive letters have been assigned to volumes in WinPE, run the command diskpart -> list vol (in my example, the drive letter C:\ is assigned to the disk on which Windows is installed, and I will use this drive letter in the next commands). diskpart - get assigned drive letters
  3. In this example, we will use the WIM file from the Windows installation media as a repair source. Run the following command to repair the offline Windows component store.
    Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim
    dism /cleanup-image - restore offline windows 10 image from source wim file
  4. If there is not enough free space on the target system drive, you can use a separate drive or USB flash drive with enough free space to store DISM’s temporary files. For example, if the additional drive is F: , I will create an empty scratch directory: mkdir F:\scratch . Then run the component store repair while specifying this temporary scratch directory: Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /ScratchDir:F:\scratch
  5. Check the system files and repair the corrupted ones using the SFC tool in offline mode: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
    sfc /scannow offline: offbootdir offwindir
 Tip. Here are some useful DISM commands that every administrator should know:

  • DISM /Add-Package –install MSU/CAB update files, integrate security updates into the Windows image
  • DISM /Get-Drivers – get the list of installed drivers
  • DISM /Add-Driver – inject drivers into the Windows installation image
  • DISM /Export-Driver – export installed Windows drivers
  • DISM /Add-Capability – used to install additional Windows features via Features on Demand (FoD). For example, RSAT, OpenSSH server, or Windows SSH client)
  • DISM /Enable-Features and /Disable-Features – enable and disable Windows optional features (for example, the SMBv1 protocol)
  • DISM /StartComponentCleanup – clean up the Component Store and remove old component versions (from the WinSxS folder);
  • DISM /Set-Edition – upgrade from the evaluation to the full Windows edition without reinstalling.

SFC /ScanNow: Repair Corrupted Windows System Files

Once you have repaired the Windows Component Store using DISM, you can use the System File Checker (SFC) tool to verify and repair the integrity of the protected system files.

First, use the /verifyonly option to check whether any system files require repair. This performs the integrity check without attempting to repair any detected issues.

sfc /verifyonly

sfc /verifyonly

Beginning system scan.  This process will take some time.
Beginning verification phase of system scan.
Verification 100% complete.
Windows Resource Protection did not find any integrity violations.

If corrupted files are detected, and you want to perform a full integrity scan and automatic repair, run:

sfc /scannow

If the sfc /scannow command detects any missing or corrupt system files, it will try to replace them with the original versions from the Windows component store (C:\Windows\WinSxS).

It is likely that it will be able to restore any damaged or missing system files and display a success message.

Windows Resource Protection found corrupt files and successfully repaired them.

tool sfc /scannow - Windows Resource Protection found corrupt files and successfully repaired them

If the SFC.exe doesn’t detect any damage to the system files, a message will appear

Windows Resource Protection did not find any integrity violations.
The SFC tool logs all its actions to the %windir%\logs\cbs\cbs.log . All SFC entries in the CBS.log file are tagged with [SR]. To list only entries related to SFC from the CBS log, use the following command:

findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfc.txt"

If the sfc /scannow command returns the error “Windows Resource Protection found corrupt files but was unable to fix some of them“, it is likely that the tool could not locate the necessary system files in the Windows Component Store.

sfc /scannow Windows Resource Protection found corrupt files but was unable to fix some of them

It is probable that you have not yet attempted to repair the Windows Component Store using the DISM.exe command. After repairing the Windows image, you can run the SFC tool again to repair system files.

10 comments
19
Facebook Twitter Google + Pinterest
Windows 10Windows 11Windows Server 2022Windows Server 2025
previous post
Find Windows Version, Edition, and Build from ISO or WIM file
next post
Troubleshooting: Group Policy (GPO) Not Being Applied to Clients

Related Reading

How to Repair EFI/GPT Bootloader on Windows 10...

March 16, 2024

How to Restore Deleted EFI System Partition in...

July 21, 2026

How to Repair Windows Boot Manager, BCD and...

March 11, 2024

PowerShell: Get Folder Size on Windows

August 21, 2026

Fix: The Computer Restarted Unexpectedly or Encountered an...

May 16, 2024

How to Download Offline Installer (APPX/MSIX) for Microsoft...

February 20, 2026

Network Computers are not Showing Up in Windows...

March 15, 2024

Windows Doesn’t Automatically Assign Drive Letters

March 15, 2024

10 comments

Andy April 21, 2020 - 7:12 am

Wow thank a lot. Can it solve the “missing Winre” to create a recovery drive?

Reply
Rot May 18, 2020 - 8:40 pm

Good article. Thank you so much!

Reply
Vivek October 7, 2020 - 6:20 pm

I need to do an offline DISM repair of my Windows 10 but the boot usb disk created does not have an install.wim file. Instead, it has install.esd file. As mentioned in the online DISM repair I used it in the /Source parameter (/Source:D:\sources\install.esd) . But during the DISM repair I get error saying source not found. The log file has many entries mentioning failure… the first failure log says –
DISM DISM Provider Store: PID=1396 TID=1740 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. – CDISMProviderStore::Final_OnConnect
Further the log file also has these entries :
CBS Session: 376_1129843 initialized by client DISM Package Manager Provider, external staging directory: (null), external registry directory: (null)
CBS Exec: Addsource called, Session: 376_1129843, Client: DISM Package Manager Provider, from GPO: No, Path: E:\Sources\install.esd
CBS The alternate source path directory could not be accessed [HRESULT = 0x8007007b – ERROR_INVALID_NAME]

Can you please help me understanding why it could be failing? And how to resolve it?
Appreciate your help

Reply
Vivek October 7, 2020 - 6:23 pm

Edit : The actual value for /Source I used is /Source:E:\sources\install.esd and not /Source:D:\sources\install.esd as I mentioned previously. (My USB boots into E drive. Windows is on C: )

Reply
Joel Wagner January 26, 2023 - 5:23 pm

I am trying to do the offline DISM repair from a USB stick created with the Windows Media Creator but there is no file “install.wim” in the X:/sources/ folder.

Reply
visitor November 11, 2024 - 6:03 am

that’s normal, it’s a esd image nowadays. yet another untested tutorial. the 15th I’m trying since yesterday

Reply
srge March 13, 2024 - 9:54 am

After the Windows Update error 0x80073712 is fixed by the removal of the pending updates:
DISM.exe /Online /Remove-Package /PackageName:Package_for_KB4520724~31bf3856ad364e35~amd64~~14393.3320.1.1 /quiet /norestart
I received DISM error:
Error: 0x800f0906
The source files could not be downloaded.
This is fixed by repairing the component files from the original ISO installation image:
dism /online /cleanup-image /restorehealth /source:e:\sources\install.wim:2 /LimitAccess

Reply
visitor November 11, 2024 - 6:06 am

error 50 & I checked the arguments of the command

Reply
srg December 12, 2024 - 5:22 am

First, run chkdsk, then DISM. And SFC as the last ones (without restart after DISM!!). This is important because the SFC repair source is the DISM repair target.
Do not change the order of the commands!

If a command returns an error, do not proceed to the next one!Troubleshoot and fix the problem first. Only when the command has been successfully executed can you move on to the next one.

Reply
P.Lampert January 8, 2025 - 11:07 am

Great summary. The best site on the subject for me, so far. It helped me solve a long-standing problem. Windows Update is working again too. Thank you!

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Enable or Disable Fast User Switching in Windows 11

    August 18, 2026
  • How to Hide Wi-Fi Network in Windows with WLAN Filters (Blacklist and Whitelist)

    August 14, 2026
  • Invalid Signature Detected: Check Secure Boot Policy [Fix]

    August 5, 2026
  • Windows Installer Service Could Not Be Accessed? How to Fix It

    July 28, 2026
  • Why Windows Reports No Internet Access: How Connectivity Detection Works

    July 26, 2026
  • Inactive TS Ports in Windows: Causes and Fixes

    July 20, 2026
  • Add Wireless Wi-Fi Profiles on Windows Devices via Export/Import or GPO

    July 13, 2026
  • CrowdSec on Windows: From Installation to Threat Blocking

    July 3, 2026
  • Manage Microsoft Store Apps with Store CLI in Windows 11 from Terminal

    July 2, 2026
  • Windows Sandbox on Windows 11: Enable, Configure, and Use

    June 10, 2026

Follow us

  • Facebook
  • Twitter
  • Youtube
  • Telegram
Popular Posts
  • How to Repair EFI/GPT Bootloader on Windows 10 or 11
  • How to Restore Deleted EFI System Partition in Windows
  • Network Computers are not Showing Up in Windows 10/11
  • Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • How to Update Trusted Root Certificates in Windows: Manual and Automatic Methods Explained
  • Fix: The Computer Restarted Unexpectedly or Encountered an Unexpected Error on Windows
Footer Logo

@2014 - 2026 - Windows OS Hub. All about operating systems for sysadmins


Back To Top