Advertisements

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.

Advertisements



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)

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

Advertisements



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

Advertisements



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

LATEST DEALS

Exclusive Student Offer_Save 10% on selected Surface devices

FEATURED POSTS

How to Change Administrator Name in Windows 10 (4 Methods)

How to Change Administrator Name in Windows 10

Introduction This guide demos how to change administrator name in Windows 10. There could be...
How to Setup WhatsApp Auto Reply in an Android Phone

How to Setup WhatsApp Auto Reply in an Android Phone

Introduction This guide demos how to setup Whatsapp auto reply in an Android phone. Steps...
How to Set Out of Office Auto Reply in Outlook, Outlook.com and Gmail

How to Set Out of Office Auto Reply in Outlook, Outlook.com and Gmail

Introduction This guide demos how to set out of office auto reply in Outlook, Outlook.com and Gmail.
How to Take Ownership of Folder in Windows 10

How to Take Ownership of Folder in Windows 10 (2 Methods)

Introduction This guide demos 2 methods to take ownership of folder in Windows 10. Options to...
How to Install Windows Server 2019 from USB

How to Install Windows Server 2019 from USB

Introduction This guide demos how to install Windows Server 2019 from USB. Steps to Install...

ADVERTISEMENTS

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

powershell version

4 Ways to Check the Current PowerShell Version on Your PC

Introduction If you are reading this guide because you want to learn how to find the PowerShell version on...
inaccessible boot device server 2016 fix

How to Fix Inaccessible Boot Device Error in Windows Server 2016

Introduction Some Windows admins have reported receiving "inaccessible boot device" error in Server 2016 after a Windows update. If...

How to Make Windows 10 Look Like Windows 7

Introduction Windows 10 is great but some Windows users still want to make windows 10 look like windows 7....
windows 10 keeps going to sleep

What to Do If Windows 10 Keeps Going to Sleep

Introduction It can be frustrating if suddenly your Windows 10 keeps going to sleep. You have to log back...
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...

RECENT POSTS

C:\G-Drive\Work Tools\Products Portal\1. New Business\2. Content Sites\1. iTechGuides.com\Posts\1. HOW TO\Microsoft\MS Office\Microsoft Word\how to add more rows to a table in word

How to Add More Rows to a Table in Word and Google Docs

Introduction This guide demos how to add more rows to a table in Word. It also has a...
How to Create a Bar Chart in Excel and Google Sheets

How to Create a Bar Chart in Excel and Google Sheets

Introduction This guide demos how to create a bar chart in Excel and Google Sheets. A bar chart is...
How to Change Administrator Name in Windows 10 (4 Methods)

How to Change Administrator Name in Windows 10

Introduction This guide demos how to change administrator name in Windows 10. There could be...
How to Create a Pie Chart in Excel and Google Sheets

How to Create a Pie Chart in Excel and Google Sheets

Introduction This guide demos how to create a pie chart in Excel and Google Sheets. A pie chart is...

iTechGuides’ Top 10 Online Games

The gaming world is getting bigger day by day. Many people are getting engaged to play online games worldwide.

How to Open Local Security Policy in Windows 10 (5 Methods)

Introduction This guide demos how to open local security policy in Windows 10. Options to...

How to Change Network from Public to Private in Windows 10

Introduction This guide demos 2 methods to change network from public to private in Windows 10.
How to Disable Touchpad in Windows 10 for Dell or HP Laptop

How to Disable Touchpad in Windows 10 for Dell or HP Laptop

Introduction This guide demos how to Disable Touchpad in Windows 10 for a Dell or HP laptop.

How to Change Account Picture in Windows 10 (2 Methods)

Introduction This guide demos 2 methods to change account picture in Windows 10. Windows 10...
How to Create Xbox Live Account

How to Create Xbox Live Account (2 Methods)

Introduction This guide demos 2 methods to create Xbox Live account. Options to Create Xbox...

ADVERTISEMENTS

MUST READ

Android games: PUBG Mobile

iTechGuides’ Top 10 Android Games

Looking to have more fun on your android phone? We have listed the best android games that will give you loads of...
How to Setup Outlook Automatic Message Reply (Not Out Of Office)

How to Setup Outlook Automatic Message Reply (Not Out Of Office)

Introduction This guide demos how to setup Outlook auto reply messages. The guide is not about setting up Outlook...
Excel Count

Excel Count: How to Count in Excel With Examples

Introduction Excel COUNT Function is used for counting items in a worksheet. Excel COUNT also has the conditional function,...
change computer name - rename a windows 10 pc

4 Methods to Rename (Change the Name of) a Windows 10 PC

Introduction This guide demos 4 methods you can use to change computer name for a Windows 10 PC. You...
Powershell Substring

How to Extract a Powershell Substring from a String

Introduction A substring is a part of a string. You can create a PowerShell substring from a string using...

LATEST DEALS

Exclusive Student Offer_Save 10% on selected Surface devices

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