Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

Using the DISM Command Prompt Tool to Repair Windows

It’s a powerful tool with a long, technical name.

DISM is a tool included with Windows that can repair some types of Windows corruption.
Tools in your toolbox.
(Image: DALL-E 3)

There’s the system file checker (SFC); it makes sure your system files are the files they’re supposed to be and haven’t been altered or replaced.

There’s repairing Windows with a reinstall, which, as the phrase implies, reinstalls or “refreshes” Windows by replacing all its files to their initial condition.

Between those two extremes is DISM, another valuable tool to have in your “How to fix Windows” toolbox.

Become a Patron of Ask Leo! and go ad-free!

TL;DR:

The DISM Command Prompt tool

DISM is a tool for Windows repair that lies between the System File Checker (SFC) and a full Windows reinstall in power. It is run in an administrative Command Prompt in three steps:

  • DISM /Online /Cleanup-Image /CheckHealth
  • DISM /Online /Cleanup-Image /ScanHealth
  • DISM /Online /Cleanup-Image /RestoreHealth

Running DISM is safe even on healthy systems and can stabilize Windows if problems are detected.

DISM

DISM — Deployment Image Servicing and Management — is a tool present in Windows 10 and 11 that can be used for a number of things. To quote Microsoft, it’s:

“A command-line tool that can be used to service and prepare Windows images, including those used for Windows PE, Windows Recovery Environment (Windows RE) and Windows Setup. DISM can be used to service a Windows image (.wim) or a virtual hard disk (.vhd or .vhdx).”

That definition conceals the fact that DISM can be used to repair existing Windows installations.

It’s generally a three-step process.

Step 0: Run an administrative Command Prompt

All three steps require you to run a Command Prompt (or PowerShell or Terminal) with administrative privileges. The easiest way is to right-click on the Start button and click on the respective item with “(Admin)” listed.

Running an Admin command prompt.
Running an Admin command prompt. (Screenshot: askleo.com)

Step 1: CheckHealth

The first run uses the “CheckHealth” option to check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired. Type the string of characters below into the administrative Command Prompt.

DISM /Online /Cleanup-Image /CheckHealth

Translated:

  • /Online means to operate on the currently running version of Windows.
  • /Cleanup-Image indicates we’ll be using the image check and repair tools.
  • /CheckHealth checks if some portion of Windows has been flagged as corrupted.
DISM Checking Health.
Step 1: Running the DISM CheckHealth function. (Screenshot: askleo.com)

Step 2: ScanHealth

ScanHealth scans for component store (storage) corruption. You may know the component store by its folder name: C:\Windows\WinSxS.

DISM /Online /Cleanup-Image /ScanHealth

Aside from the “/ScanHealth” option itself, the other options are the same as for “/CheckHealth”.

This operation will take a little more time.

DISM scanhealth operation.
Step 2: Running the DISM ScanHealth operation. Click for larger image. (Screenshot: askleo.com)

Step 3: RestoreHealth

The “/RestoreHealth” operation is much like the “/ScanHealth” operation, except it attempts to fix any problems it finds.1

DISM /Online /Cleanup-Image /RestoreHealth

Options are similar to our preceding runs, except, of course, for the “/RestoreHealth” option itself.

DISM RestoreHealth
Step 3: Running DISM RestoreHealth. Click for larger image. (Screenshot: askleo.com)

No harm, no foul

As you can see by my examples above, there’s no harm in running DISM even if your machine has no problem. In fact, that’s probably the desired result.

On the other hand, if problems are detected and repaired, presumably that’ll lead you to a more stable, problem-free Windows experience.

Do this

In general, if I’m experiencing what I think is a system problem, I’ll address it in three steps.

As I said, DISM is another tool in our toolbox.

Another helpful tool? Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

Podcast audio

Play

Footnotes & References

1: This is similar to the CHKDSK /F option. Without it, CHKDSK just scans and reports, and with it, CHKDSK scans and repairs.

8 comments on “Using the DISM Command Prompt Tool to Repair Windows”

  1. I learned about DISM a few years ago when I was dealing with some problems on a computer. It is a powerful tool to have in the box. I have even gone as far learning how to use it with a separate Windows image using the DISM /Offline commands.
    I’d warn others that it can be a rather deep rabbit hole to go down, but one can learn a lot about Windows exploring DISM. Just make sure to have a backup before hand.

    Reply
  2. Hi, Your demonstration was done on WIN10 machine.
    On WIN11 there is no “Terminal (Admin).
    How do I reach the DISM feature ?

    Reply
  3. I didn’t see any of those either, but this works: Press the “Windows key + X” keyboard shortcut.
    Thanks for the information, you always have great tips that we don’t see at other forums.

    Reply
  4. Leo,
    Thank you for posting this item! I’ve been using the “RestoreHealth” option for several years, but I didn’t know about the other two options that are available. That’s probably on me, but then again, Microsoft is abysmal about documenting their system utilities.

    If I understand you correctly, the first two commands serve to inform me if the third needs to run (or rather, whether it won’t help). If I have that wrong, please explain in greater detail,

    Ernie (Oldster)

    Reply
  5. When I opened the Terminal (ADMIN) to run the three DSIM commands I received the following message “Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows“. Shouldn’t Windows update have kept my pre-installed Windows 11 PS up to date? I don’t know what version of PS I have and don’t know which version I should download and install because this article doesn’t mention this message.

    Reply

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.