Windows Client OS

Fix Corrupt Windows System Files Using DISM

In this Ask the Admin, I’ll show you how to fix corrupt system files when System File Checker isn’t up to the job.



Sponsored Content

Passwords Haven’t Disappeared Yet

123456. Qwerty. Iloveyou. No, these are not exercises for people who are brand new to typing. Shockingly, they are among the most common passwords that end users choose in 2021. Research has found that the average business user must manually type out, or copy/paste, the credentials to 154 websites per month. We repeatedly got one question that surprised us: “Why would I ever trust a third party with control of my network?

Windows 10 has proven to be the most reliable version of Windows yet. But that doesn’t mean that it’s completely immune from file corruption. If your Windows installation is exhibiting strange behavior or performance problems, it’s possible that corrupt system files could be causing the issue.

Before running any of the commands below, check the Event Log to see if anything unusual is going on. Other things worth checking out are disk health, using the chkdsk command, free disk space, and performing a clean boot to ascertain whether third-party drivers or applications might be the root of the problem. Microsoft has a guide to clean booting Windows 10 here.

Hard Disk Integrity

To verify the integrity of the system disk, first run a scan using chkdsk. If the system disk is labeled C:, which it is in most cases, the command would look like this:

chkdsk C:

Don’t forget to make sure you open the command prompt with elevated privileges. Type cmd in the search box in the bottom left of the taskbar and then right-click Command Prompt in the list of results. Select Run as administrator from the menu. Enter an administrator username and password if prompted.

If the utility finds any errors, you can fix them by adding the /f switch:

chkdsk C: /f

Before using chkdsk to fix any errors, I recommend backing up any important data on the drive.

System File Checker

If you suspect that corrupt system files are causing issues in Windows, the first thing to do is to run a scan using System File Checker (SFC). Open a command prompt with administrator privileges and run the command as shown below:

sfc /scannow

Performing a complete scan of the system can take a considerable amount of time. Once the scan has finished, it will report that either it hasn’t found any problems, that it found some problems and was able to fix them, or that it found problems and wasn’t able to fix them while the system is online. If SFC can’t fix issues while the system is online, reboot the system in Safe Mode and run the command again. To boot Windows 10 in Safe Mode, see Microsoft’s instructions here.

Deployment Image Servicing and Management

Running System File Checker in safe mode isn’t a guarantee that it will be able to fix the problems. When SFC fails to clean up Windows, the Deployment Image Servicing and Management (DISM) tool can usually come to the rescue. Run the following commands in an elevated command prompt.

DISM.exe /Online /Cleanup-image /Scanhealth
DISM.exe /Online /Cleanup-image /Checkhealth
DISM.exe /Online /Cleanup-image /Restorehealth

The first command uses the /Scanhealth switch to check whether the online image is repairable. The /Checkhealth switch then determines whether any corruption has been detected. Finally, if the image is repairable, you can use the /Restorehealth switch to repair Windows.

Using DISM to fix corrupt Windows system files (Image Credit: Russell Smith)
Using DISM to Fix Corrupt Windows System Files (Image Credit: Russell Smith)


In the example above, DISM uses Windows Update to replace any corrupt files when the /Restorehealth switch is specified. Alternatively, you can prevent DISM accessing Windows Update by using the /LimitAccess switch. But in this case, you’ll need to provide your own source for replacing any corrupt files by providing a path to a mounted WIM image using the /Source switch. This can be useful in scenarios where servers don’t have access to the Internet.

DISM /Online /Cleanup-Image /RestoreHealth /Source:c:\test\mount\windows /LimitAccess

If you don’t specify the /Source switch, DISM will use the default location that’s configured for Features on Demand. For more information on configuring a default location for a Windows repair source, see Microsoft’s website here.

In this article, I showed you how to check the integrity of your PC or server’s system disk and use the System File Checker and DISM utilities to repair corrupt system files.

Follow Russell on Twitter @smithrussell.


Related Topics:


Don't have a login but want to join the conversation? Sign up for a Petri Account

Comments (1)

One response to “Fix Corrupt Windows System Files Using DISM”

  1. <p>You would think by now there would be a program/utility that would do the following</p><p>Disk SMART check</p><p>check disk</p><p>dism scan health</p><p>dism fix health</p><p>sfc /scannow,</p><p><br></p><p>I've created a batch utility that I run pretty often but this should be built in to windows</p>

Leave a Reply

IT consultant, Contributing Editor @PetriFeed, and trainer @Pluralsight. All about Microsoft, Office 365, Azure, and Windows Server.
13 Email Threat Types to Know About Right Now

As email threats evolve and multiply, keeping track of them all—and staying protected against the many different types—becomes a complex challenge. Today, that requires more than just the traditional email gateway solution that used to be good enough.

In this eBook you will learn:

  • What are the most common and challenging email attacks for organizations?
  • How to defend against sophisticated email threats, such as spoofing, social engineering, and fraud
  • How to protect employees at the inbox level with the right technologies and security-awareness training
  • How to use a multilayered protection strategy to reduce susceptibility to email attacks and better defend your business and employees

Sponsored by: