It's a powerful tool with a long, technical name.
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!
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.
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.
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.
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.
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.
- I'll run the system file checker (SFC).
- I'll run DISM as described above.
- Then, if the problem remains and is serious enough, I'll refresh Windows.
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
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.
As soon as I saw that graphic you made for the article, I got the gist of the article. Good work!
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.
Hi, Your demonstration was done on WIN10 machine.
On WIN11 there is no “Terminal (Admin).
How do I reach the DISM feature ?
You may have Command Prompt, or PowerShell. This works in those as well.
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.
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)
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.
I’ve been ignoring that. I’m not sure the relationship to the Windows update flow. (I still spend most of my time in Command Prompt anyway. )
I have another question. Where does the Image dism scans from comes from?
Is it on Microsoft servers? In corporate environment is it on on some internal windows server? If so how can locate the server path it lies on?
I believe in the WinSXS folder, but I could be wrong. I know it’s not online.