DISM.exe /Online /Cleanup-Image /Restorehealth Explained



What is DISM.EXE /Online /Cleanup-image /RestoreHealth?

“DISM.exe /Online /Cleanup-Image /Restorehealth” is a DISM command that repairs issue with the running Operating system you are logged into.

Before I go further to explain what “DISM.exe /Online /Cleanup-Image /Restorehealth” does, lets define DISM.exe first.

What is DISM.EXE?

DISM.exe (Deployment Image Servicing and Management) is a Windows command line tool that is used to manage both Windows Online and Offline Images.

DISM.exe /Online /Cleanup-Image /Restorehealth Explained

As I said in my introduction, this command fixes any problem(s) identified in your current operating system.

But what does each switch in this command do? I will explain the switches and put it all together for you.

Sponsored Content

DISM.exe /Online vs /Image

When you run DISM.exe command, you must either specify the /Online or /Image switch. If you specify the /Online switch, DISM.exe will not expect a path to an offline image. Rather, the command tool will target the running operating system.

On the other hand, if you specify the /Image switch, Deployment Image Servicing and Management tool will expect you to specify the path to the root directory of an offline Windows image.

DISM.exe supports Windows image (.wim) file or virtual hard disk (.vhd or .vhdx) as offline images.

So, DISM.exe /Online switch means you are asking DISM to target the running Operating system instead of an offline image. In the next section, I will explain the /Cleanup-Image switch.

DISM.exe /Cleanup-Image

For DISM.exe command to work, the /Online or /Image switch must be followed by other image servicing commands. One of the command line options for the DISM.exe /Online switch is the /Cleanup-Image switch.

So, what does the /Cleanup-Image switch do in our “DISM.exe /Online /Cleanup-Image /Restorehealth” command? The /Cleanup-Image switch performs cleanup and recovery operations on the running Operating System.

To put it together to this point: when you run the command “DISM.exe /Online /Cleanup-Image”, you are asking Deployment Image Servicing and Management tool to:

  1. Target the running Operating System
  2. Perform cleanup and recovery operations on the running Operating System

DISM.exe /Restorehealth

The last switch in “DISM.exe /Online /Cleanup-Image /Restorehealth” command is the /Restorehealth switch. The /RestoreHealth switch scans the Operating System for corrupt files. If DISM finds corrupt files, it attempts to repair them automatically.

When you run the command ” DISM.exe /Online /Cleanup-Image /Restorehealth”, it may appear to be stuck. Do not panic. Give it sometime. It will usually complete.

What Does “DISM.exe /Online /Cleanup-Image /Restorehealth” Do?

With the 3 switches in the command explained, I can summarize what the command does.

When you run DISM.exe /Online /Cleanup-Image /Restorehealth command, it does the following:

  1. The /Online switch instructs DISM.exe to target the running Operating System instead of an offline Windows image (.wim) file or virtual hard disk (.vhd or .vhdx)
  2. The /Cleanup-Image switch performs cleanup and recovery operations on the running Operating System
  3. Finally, the /Restorehealth switch scans the running Operating System for corrupt files and attempts to fix them.

Below is the result of the command.

DISM.exe /Online /Cleanup-Image /Restorehealth - (Deployment Image Servicing and Management)

How to Use DISM.EXE to Check Your Operating System Health

I suppose by now, you are probably thing “can DISM.exe help me find problems in my OS?” Yes, it can! If you are having problems with your Windows computer, use the /ScanHealth switch to perform advanced scan. See the command below:

DISM /Online /Cleanup-Image /ScanHealth

The result of the command is shown in the image below:

DISM.exe /Online /Cleanup-Image /Restorehealth - (Deployment Image Servicing and Management)

Sponsored Content

Run DISM.EXE from Windows 10 Recovery Mode

Sometimes Windows may not even boot. If you wish to repair your Windows 10 computer that does not boot at all, use the steps below:

  • Download Windows 10 ISO, burn it into a DVD and boot your computer with it. For a step by step guide on how to download Window 10 ISO image, read Download Windows 10 ISO Image.
  • When your computer boots to the screen shown below, press any key to boot into the Windows 10 DVD.
DISM /Online /Cleanup-Image /RestoreHealth /Source:< path-to-install.wim>
  • On the Windows Setup screen, click Next. Then click Repair your computer.
DISM /Online /Cleanup-Image /RestoreHealth - Deployment Image Servicing and Management
  • Next, click Troubleshoot. Then click Command Prompt.

Sponsored Content

  • Command Prompt loads.
To repair Windows 10 from the ISO, we require Install.WIM. Unfortunately, Install.WIM is not readily available in Windows 10 ISO. It has to be extracted.

Extract Install.WIM from Windows 10 ISO

As I said earlier, before you can use DISM /Online /Cleanup-Image /RestoreHealth command with a WIM file, the file has to be extracted.

Follow the steps below to extract the OS WIM file from install.esd:

  • First, you need to determine the drive your ISO image was mounted. This will depend on the number of drives on your computer. Knowing that it cannot be drive C, try D, then E and so on.
  • To change to a drive, enter the drive name, followed by colon then press Enter.
  • Next, type Dir and press the Enter key.
DISM /Online /Cleanup-Image /RestoreHealth - Deployment Image Servicing and Management

Keep checking possible drive letters until you find the one with folders, boot, efi, sources and support. This is the drive your Windows 10 ISO is mounted.

  • Next, you need to find the index number of the Windows 10 edition you wish to use. To do this, execute the command below:
cd sources 
  • Then, type this command and press the enter key.
dism /Get-WimInfo /WimFile:install.esd

The result of the last command is shown below:

DISM /Online /Cleanup-Image /RestoreHealth - Deployment Image Servicing and Management

All the Windows 10 editions are listed with their index number. As the edition installed on my computer is Windows 10 Pro, I need to use the same edition for DISM repair. To see the index number, I need to scroll down a bit. Here are the details of Windows 10 Pro.

The index number I need is 6.

Before you proceed, you need to create a folder to extract your Install.WIM file to. To do this type the command below and press Enter.

mkdir d:\test
I created the folder in drive D because I know it exists. Replace drive D with a drive that exists on your computer.
  • Now it is time to extract Install.WIM to d:\test folder. To do this, run the command below:
dism /export-image /SourceImageFile:install.esd /SourceIndex:6 /DestinationImageFile:d:\test\install.wim /Compress:max /CheckIntegrity
This command must be run from the /Sources folder of the ISO mount drive. Note that it will take a while for the command to complete.

When the command completes, proceed to the next step.

DISM /Online /Cleanup-Image /RestoreHealth - Deployment Image Servicing and Management
  • Finally, to repair windows 10 using intall.wim, run the command below:

DISM /Online /Cleanup-Image /RestoreHealth /Source:d:\test\install.wim

When I ran the command it returned error 50: DISM does not support servicing Windows PE with the /Online option. If you receive this error message, find the resolution below this image.

How to Fix DISM Error 50

If you receive error 50 – “dism does not support servicing windows PE with the /online option”, resolve it with the steps below:

  • From the command prompt, type regedit and press enter. Registry editor opens.

Sponsored Content

  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control. Right-click MiniNT key and delete it. On the delete confirmation, click Yes.
DISM /Online /Cleanup-Image /RestoreHealth - Deployment Image Servicing and Management
  • On the command prompt, type Exit and press Enter. Then Select Turn Off your PC.
When you reboot your computer and load command prompt, you do not need to Extract Install.WIM from Windows 10 ISO again.
  • When Command Prompt loads, change to the drive letter where your ISO is mounted. Also change to the \Sources directory. Then rerun the DISM command shown below:
DISM /Online /Cleanup-Image /RestoreHealth /Source:d:\test\install.wim 

If error 50 persists, get more information on how to resolve it from this guide – How to quickly fix DISM error 50 on Windows 10 (opens in a new window/tab). You may also read the DISM log shown in the error message.

How to Fix DISM.exe /Online /Cleanup-Image /Restorehealth Error 87

There are so many reasons why you may receive error 87 when you run the “DISM.exe /Online /Cleanup-Image /Restorehealth” command. Here are some of the causes of the error and how to fix them.

DISM.exe /Online /Cleanup-Image /Restorehealth Error 87: Solution 1

From my research, the top on the list is when you run the command without adding the required spaces in the switches. Below is the DISM command without spaces:


Run the command with spaces as shown below:

DISM.exe /Online /Cleanup-Image /Restorehealth

DISM.exe /Online /Cleanup-Image /Restorehealth Error 87: Solution 2

Another reason for error 87 could be pending updates.

The solution is to install all and any pending updates.

To check for and install any pending update, follow the steps below:

  • Right-click Windows logo on the left of your task bar [1]. Then click System [2].

Sponsored Content

DISM /Online /Cleanup-Image /RestoreHealth - Deployment Image Servicing and Management
  • When Settings loads, type updates in the search bar [1]. Then select Check for updates. Check the part labelled [3] for pending updates. If any click install.


DISM.exe is a very important Windows Command-line tool with many functionalities. I hope the content of this guide have been helpful.

If you have any question or comments, use the “Leave a Reply” form at the end of the guide. Alternatively, you could share your experience so other readers can benefit from it.

Other Helpful Guides

Additional Resources and References


Please enter your comment!
Please enter your name here


network discovery keeps turning off server 2016

How to Fix Network Discovery If it Keeps Turning Off in Server 2016

Does network discovery keep turning off in your Windows server 2016? It is likely that one of its dependent services is not...
how to install windows 10 1903 update manually

How to Install Windows 10 1903 Update Manually

Windows 10 1903 Update was released in May, 2019. But some users are not yet offered the update via automatic update. The...
spotify web player not working

Spotify Web Player Not Working [Fixed]

Introduction Spotify Web Player may stop working for you with the following error messages: "Spotify Web Player an Error...
DISM.exe /Online /Cleanup-Image /Restorehealth

DISM.exe /Online /Cleanup-Image /Restorehealth Explained

What is DISM.EXE /Online /Cleanup-image /RestoreHealth? "DISM.exe /Online /Cleanup-Image /Restorehealth" is a DISM command that repairs issue with the...
DHCP Relay agent

DHCP Relay Agent: Configuration in Windows Server 2016

What is a DHCP Relay Agent? A DHCP Relay Agent allows DHCP clients in a different network subnet to...


Remote Desktop Connection

Remote Desktop Connection an Internal Error Has Occurred [Fixed]

Introduction I recently received the error message "Remote Desktop Connection an Internal Error Has Occurred". It was strange because...

Find My Samsung: Register and Use Samsung Find my Mobile

Introduction Ever wondered how you could find your Samsung phone if you lost it? Find my Samsung or Samsung...
What is the Difference Between PowerShell and CMD?

Windows Powershell vs CMD: Differences and Similarities

Introduction This short guide compares Windows PowerShell vs CMD (Windows command prompt). I will cover the history and nature...
Spotify No Longer Supports this Version of Microsoft Edge

Spotify No Longer Supports this Version of Microsoft Edge [Fixed]

Introduction When you open Spotify web player on Microsoft Edge, you may receive the error message "Spotify No Longer...
Windows 10 Won't Boot

Windows 10 Won’t Boot With Black Screen? 3 Ways to Fix It

Why Won't Windows 10 Boot Up? If your Windows 10 stops with a black screen, the first question in...


windows safe mode

2 Easy Ways to Start Windows 10 Safe Mode

Introduction In previous versions of Windows you could start safe mode by pressing F8. But in Windows 10, F8...
we can t sign into your account

How to Fix “We Can’t Sign into Your Account” Error in Windows 10

Introduction You may receive "we can't sign into your account" error after upgrading to Windows 10. If this occurs...
how to move columns in excel

How to Move Columns to Rows and Rows to Columns in Excel

Introduction If you receive some Excel data in columns, you can easily move the columns to rows in Excel...
YouTube Music Playlist

YouTube Music Playlist: How to Create Playlists and Add Songs

Introduction A YouTube music playlist allows you to add a collection of songs or videos into a single location....

How to Fix “The User Profile Service Failed the Logon” in Windows 10

Introduction "The user profile service failed the logon Windows" error is likely to occur after an upgrade to Windows...


disable cortana windows 10 featured

How to Disable Cortana in Windows 10 (2 Methods)

Introduction Some Windows 10 users may not like Cortana. Solution? Disable Cortana. You are probably reading this because you...
bootrec /fixboot access is denied

How to Fix BootRec /FixBoot Access is Denied Error in Windows 10

Introduction BootRec /FixBoot Access is Denied Error in Windows 10? This error is likely caused by corrupt EFI directory.
Reset Windows 10

How to Reset Windows 10 (2 Methods)

Introduction If your Windows 10 is broken, one available way to fix it is to use Windows 10 reset....
system restore windows 10

How to Enable and Use System Restore in Windows 10

Introduction System restore in windows 10 is a very important tool that is probably ignored by most users. But...
windows has stopped this device code 43

How to Fix Windows Has Stopped this Device Code 43 Error

Introduction Sometimes you may receive "Windows has stopped this device code 43" error. This error is likely to come...
Windows could not automatically detect this network's proxy settings

How to Fix “Windows Could not Automatically Detect this Network’s Proxy Settings”

Introduction You suddenly lose the ability to connect to the internet. Then you run network troubleshooter and it returns...
printer offline

5 Ways to Restore Your Printer Online If Status is Offline

Introduction Is your printer offline? Setting it online is very simple but sometimes it is more than just setting...

How to Fix “BootMgr is Missing” Error in Windows 10

Introduction If you receive Fix "BootMgr is missing" Error in Windows 10, the default response is panic! But you...
windows 10 search featured

How to Fix Windows 10 Search If it Stops Working

Introduction Are you having troubles with Windows 10 search? Apparently, it is a fairly common problem with a number...
oooops, something went wrong. reload

How to Fix “Oooops something went wrong. reload” Spotify Error

Introduction If you receive "Oooops something went wrong. reload" Spotify error, do not panic. The fix is simpler than...


iPhone SE vs iPhone 6s compared - which to buy

iPhone SE vs iPhone 6s Compared: Which to Buy

Introduction Considering whether to buy iPhone SE vs iPhone 6s? Not sure which is better? When I am trying...
Amazon Orders

Amazon Orders: Everything You Need to Know

Introduction Ever wondered whether you can hide some of your Amazon orders? Yes, you can! But how do you...
how to change wifi password

How to Change Wifi Password for Any Wifi Router

Introduction To change your Wifi password (PIN), you need the IP address and admin login for the router. Once...
Absolute Reference vs Relative Reference Excel

Absolute Reference vs Relative Reference Excel: Quick Guide

What is Absolute Reference in Excel? Absolute reference in excel allows you to reference a particular row or column...
windows modules installer worker high cpu 2

How to Fix Windows Modules Installer Worker High CPU

Introduction If Windows Modules Installer Worker has high CPU usage, it may slow your computer down. Windows Modules Installer...

By using this website you agree to accept our Privacy Policy and Terms & Conditions