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.

Tip
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.

Tip
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.
Tip
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.
D:
  • Next, type Dir and press the Enter key.
DIR
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
Tip
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
Tip
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.
Tip
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:

Solution

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.

Solution
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.

Conclusion

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

FEATURED POSTS

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...

TRENDING POSTS

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...

BEST OF ITECHGUIDES

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...
powershell sleep

PowerShell Start-Sleep Command: Syntax, Examples

Introduction Powershell Sleep (Start-Sleep) Cmdlet is a very useful scripting tool. There may be instances when you want to...
windows was unable to complete the format

Windows was Unable to Complete the Format [Fixed]

Introduction When you try to format a USB stick or SD memory card you may receive the message "Windows...
PowerShell-NoTypeInformation

Powershell NoTypeInformation: Applications and Examples

Powershell NoTypeInformation: Why So Much Interest? I chose to write on 'Powershell -NoTypeInformation' because so many people ask questions...
bullet points in excel

4 Easy Ways to Insert Bullet points in Excel

Introduction Inserting bullet points in excel is not as straightforward as adding bullet points in Word. This guide demonstrates...

RECENT POSTS

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...

MUST READ

spotify no longer supports this version of chrome

How to Fix “Spotify no Longer Supports this Version of Chrome”

Introduction Have you been frustrated by "Spotify no Longer Supports this Version of Chrome" error? You are not alone!...
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...
windows system32 config systemprofile desktop is unav

How to Fix “C:WINDOWSsystem32configsystemprofileDesktop Is Unavailable” Error in Windows 10

Introduction You may receive the error message "WINDOWS system32 config systemprofile Desktop is unavailable" after upgrading to Windows 10....
iPad Won't Charge

iPad Won’t Charge? How to Fix It

Why Won't iPad Charge? If your iPad won't charge it could be for a number of reasons. Here are...
foreach in file powershell

How to Iterate the Content of a Text File in Powershell in 2 Easy...

Introduction If you have a text file with data you wish to use, you can use PowerShell Get-Content ...

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