Run DISM command Windows 10

Windows system files are the core components of the operating system that enable it to function properly. However, if for some reason important system files are corrupted or altered, it can cause a wide range of problems from random crashes and slow performance to failed updates and even the dreaded Blue Screen of Death (BSOD). Well, Windows system files can be corrupted or damaged due to sudden power outages, hardware failures, software bugs, malware, or improper shutdowns. To deal with such situations, Microsoft includes built-in System File Checker (SFC) and Deployment Imaging Service and Management Tool (DISM) that automatically scan and repair corrupt Windows System Files. Whether you’re running into performance issues or want to repair corrupted files in Windows 11, this article is for you.

What is a corrupted system file?

A corrupted system file is a computer file that has been damaged or altered in a way that makes it unusable or inaccessible. This damage can prevent the file from opening, cause it to display incorrectly, or lead to errors when the file is used.

There are several reasons why a file may become corrupted, including malware, hardware issues like hard drive failures, power outages, and problems during software updates or installations.

  • Hardware Issues: Problems with storage devices (like hard drives or SSDs), memory, or other hardware components can lead to data corruption.
  • Software Errors: Bugs in the software that create, edit, or read the file can cause it to be written incorrectly.
  • Power Failures: Sudden power loss during a write operation can leave the file in an incomplete or damaged state
  • Malware: Malicious software can intentionally alter or corrupt files as part of its attack.

How to Fix Corrupted Files in Windows 11

Microsoft primarily designed built-in tools like System File Checker (SFC) and Deployment Image Servicing and Management (DISM) to scan and repair corrupted files in Windows PC. Also, you can try System Restore, Startup Repair, or even consider resetting your PC as a last resort. These tools help scan for and repair corrupted system files or revert your system to a previous stable state.

Run System File Checker (SFC) to Repair System Files

System File Checker (SFC) is a built-in command-line utility that scans for and restores corrupted Windows system files using a cached copy stored locally on your PC (%WinDir%\System32\dllcache). It compares your current system files with the correct versions stored in the Windows component store. If it finds discrepancies, it attempts to replace the corrupted files with healthy ones.

  • Click on the Start button, Type cmd in the search bar.
  • Right-click on “Command Prompt” and select “Run as administrator.” You’ll be prompted to confirm; click “Yes.”
  • Type the command sfc /scannow and press the Enter key to scan your system files for corruption and attempt to repair them.

SFC scan windows 11

Here, the sfc: Calls the System File Checker utility and /scannow: Instructs SFC to scan all protected system files and replace corrupted files with cached copies.

The scan may take 10–15 minutes or more, depending on the system file corruption level. If issues are found, SFC will attempt to replace corrupted files automatically.

Once the scanning is complete, you’ll get one of the following messages:

  • Windows Resource Protection did not find any integrity violations – No problems found.
  • Windows Resource Protection found corrupt files and successfully repaired them – Issues fixed.
  • Windows Resource Protection found corrupt files but was unable to fix some of them – Use DISM next.

Always restart your computer after running the SFC scan to ensure changes are applied.

Use DISM Tool to Fix Corrupted System Files

While SFC focuses on existing system files, DISM is more about the “health” of the Windows image itself, from which SFC draws its clean copies. If the Windows component store itself is corrupted, SFC might not be able to do its job effectively. That’s where DISM comes in. It can repair the underlying Windows image, making it possible for SFC to then successfully repair individual system files.

If the SFC tool can’t repair certain files, the DISM restorehealth command repairs the Windows image and prepares it for successful SFC scans.

There are three main options you can use with DISM to repair the Windows image on your computer, including CheckHealth, ScanHealth, and RestoreHealth.  

The DISM tool writes the following log files, which can be used to analyze the operation status and errors:

  • C:\Windows\Logs\CBS\CBS.log
  • C:\Windows\Logs\DISM\DISM.log

DISM CheckHealth Command

To fix and repair Windows 11 using DISM, First Open the command prompt as an administrator. Then type the Following command and hit Enter key to execute the command.

Dism /Online /Cleanup-Image /CheckHealth

DISM CheckHealth

Note: The /CheckHealth is used to check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired. This command doesn’t fix anything, only reports the problems if any.

DISM ScanHealth Command

Also, you can use the /ScanHealth command to check the component store for corruption.

Dism /Online /Cleanup-Image /ScanHealth

It takes a significantly more extended amount of time than the CheckHealth option, but using this switch may do a thorough test, and also write the results to a log file.

DISM scanhealth command

Note: While running DISM using the /RestoreHealth or /ScanHealth, you will notice the process will seem stuck at 20% or 40%, but it’s normal behavior. After a few minutes, the operation will finish as expected.

DISM restorehealth Command

Now use the DISM command with the /RestoreHealth switch to scan the Windows image for any corruption and to perform a repair automatically.

Dism /Online /Cleanup-Image /RestoreHealth

DISM restore health command

This command actually repairs issues by downloading files from Windows Update. This process takes a long time to complete. If the problem has also extended to the Windows Update components, then you’ll need to specify a source containing the known good files to repair the image.

After running both DISM and SFC, it’s crucial to restart your computer. This allows the changes to take full effect and for Windows to properly load the repaired system files.

What if the Problem Persists?

While DISM and SFC are incredibly effective to fix corrupted files in Windows, there might be instances where they don’t completely resolve the issue. If you’re still experiencing problems:

  • Repeat the Process: Sometimes, running DISM and SFC a second or third time can catch issues that were missed initially.
  • Check Your Hard Drive: Corrupted system files can sometimes be a symptom of a failing hard drive. Consider running a disk check utility (like chkdsk) to rule out bad sectors.
  • Perform a System Restore: If you have a restore point created before the issues began, you can try reverting your system to that earlier state.
  • Reset or Reinstall Windows: As a last resort, if all else fails, you might need to consider a Windows reset (which can keep your personal files) or a clean reinstallation of Windows.
Steve Ballmer
With over 7 years of experience in the IT industry, I have experience in IT support, helpdesk, sysadmin, network admin, and cloud computing. Certified in Microsoft Technologies (MCTS and MCSA) and also Cisco Certified Professional in Routing and Switching.