Repair Windows 10 issues safely using the Built-In DISM Command

Andrew LeniartBlogger, Journalist, IT Professional, Tech Writer, Qualified Editor
CERTIFIED EXPERT
IT Professional - Helping others to help themselves. https://andrewleniart.com & https://www.computerhelpzone.com.au/testimonial/
Published:
Edited by: Rob Jurd
Learn how and when to use the Windows Deployment Image Servicing and Management (DISM) command in this helpful article and guide that discusses repairing problems often encountered with Microsoft Windows. Demystifies the DISM command function in layman's terms.

When folks are having problems with the general workings of Windows 10, the first advice they are usually given is to run an sfc /scannow (System File Checker Tool), and/or the chkdsk (Short for Check Disk) commands. That's excellent advice which can frequently help in resolving issues with all versions of Windows. 


On many occasions, those two diagnostic and corrective commands don't help, and so that's the purpose of this tutorial - to show how to go one step further to improve your chances of getting a successful repair to your problem, and that's by using the DISM command. Though there's a ton of info around about DISM, I've found folks find much of it to be cryptic and confusing, so here I'll try to explain how to use it with layman's terms using a step by step process with illustrations.


Usage in both Internet-connected and not Internet-connected scenarios are covered and explained here.




Table of Contents - [ Quick Links ]


1.  What is DISM?
6.   Using DISM without Online Access
2.  Pre-requisites for running DISM
7.    Downloading the Windows 10 ISO
3.  Opening an Administrative Command Prompt Window
8.    Mount Windows.ISO as a Virtual Drive
4.  Checking the Health of Windows 10
9.    Concluding Remarks
5.  Repairing the Health of Windows 10
10.  Other Articles





What is DISM?


According to a Microsoft help article on the topic, the purpose of DISM is explained as shown in the short extract taken from Microsoft's overview below;

Deployment Image Servicing and Management (DISM.exe) is 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). DISM comes built into Windows and is available through the command line or from Windows PowerShell.

That's great info, but not very helpful with regards to how we can use the command to repair existing Microsoft 10 installations that may be performing sub-par due to problems with the OS itself. The purpose of this tutorial isn't to get bogged down in the technicalities of DISM and how it works - instead, what I'll be concentrating on here is how to use the command safely when you're having issues with Windows 10, both online and offline.


Pre-requisites for running DISM

[Back to Top]

DISM can be run from either an administrative "CMD" command prompt or a "Powershell" window. This tutorial will concentrate on what I consider to be the easiest and safest way to run it, and that's using a command prompt, as it doesn't involve any scripting knowledge or access to a powerful shell where things can quickly go wrong if you're not careful. 


Explore using Powershell from the link provided if you want to know more, but I consider it to not be the best solution for new players or the faint-hearted, so always experiment with a large degree of care if you choose to use it until you fully understand what all the available scripts can change on your system!


Opening an Administrative Command Prompt Window

[Back to Top]

[ Tip! Click any Image in this article to view it in full size! ]


To open an administrative command prompt on Windows 10, follow these easy steps.


  1. Press your Windows Key and type CMD
  2. Right-click the "Command Prompt" result and select "Run as administrator" from the top search result

    Image showing result of pressing the Windows Key on your keyboard and typing CMD. Right click the Command Prompt result and select Run as administrator
    Answer Yes to the User Account Control prompt and an administrative command prompt window will open as shown below


Image of an Administrator Command Prompt window ready for input of commands


Now that we have an Administrator Command Prompt window open, it's time to start exploring the results of some DISM commands, along with what they do. All commands are entered in the command prompt, typed exactly as shown, including any spaces. If a command returns an error for you, copy it from this article and paste it into your command prompt window.


Note: The following assumes Online access to the Internet on the machine that is having problems.


Checking the Health of Windows 10

[Back to Top]

An easy to use DISM command switch that gives you a quick way to check the overall health of your Windows 10 installation is /CheckHealth. Enter the following command in the command prompt window, and then press your Enter key.


  • DISM /Online /Cleanup-Image /CheckHealth


Here's a sample of the result you can expect to get by running the above command on a healthy system.


Sample output of using the /CheckHealth switch

Command prompt showing the DISM command having been run and the results stating No component store corruption detected, as well as The operation completed successfully.


Note the tool reported "No component store corruption detected" and that "The operation completed successfully." The /CheckHealth switch doesn't take long to run at all and should compete in just a few seconds. If corruptions "are" found, the resulting report will tell you so. This step isn't strictly necessary, but I run it sometimes because it completes so quickly.


Sidenote: A useful thing to share at this stage is that despite DISM reporting that no corruptions were found, in my experience, running DISM with a /RestoreHealth switch can still often fix problems you are having in Windows 10, so it's worth remembering, as no harm should come to your system by using it.


Another way to check the health of your Windows 10 install is to use the /ScanHealth switch. To use it, run the same command shown above, only this time, replace /CheckHealth with /ScanHealth. The output will be similar, but it will take longer to run. See below for a typical /ScanHealth result.


Sample output of using the /ScanHealth switchCommand prompt showing the DISM command having been run and the results stating No component store corruption detected, as well as The operation completed successfully.


Note: [ Though I included the above for the sake of completeness, in my opinion, both of the above options are superfluous and need not be run. I rarely bother with running either of those checks and skip directly to the repair function of DISM as explained below. Why?


Because I've never had a problem or negative result by skipping those checks and not running them saves time. Besides that, if you run those checks and do end up getting an error reported, you'll need to run the repair option anyway, so just repairing first makes more sense to me, as nothing untoward will happen if there isn't anything that DISM can't fix anyway ]


Repairing the Health of Windows 10

[Back to Top]

The most useful switch to use with DISM is the /RestoreHealth switch. As mentioned earlier, I believe both the /CheckHealth and /ScanHealth switches are a waste of time and need not be run. No harm should come to your Windows 10 installation by skipping directly to the following and doing so will likely save you time.


In the administrative command window that you opened earlier, type the following command and press your Enter key.


  • DISM /Online /Cleanup-Image /RestoreHealth


Sample output of using the /RestoreHealth switch

Image of Administrator Command Prompt showing result of running the DISM /Online /Cleanup-Image /RestoreHealth command


The /RestoreHealth function takes the longest time to complete. However, it can often repair corrupt files in your Windows 10 installation and is well worth a try. On my system, with a high-speed Internet connection and SSD drive, the command took six minutes to complete. It's not unheard of for it to take up to 15 or 20 minutes though, depending on your hardware, internet speed, and any repairs required, so be patient.


Also, if it's taking a while and you think that the command has frozen and not doing anything during the repair, be patient and wait. It will continue and complete. Finally, following this command up with another sfc /scannow command can sometimes also be useful as I've had instances where SFC found no issues before running DISM, yet found and corrected problems after running a DISM repair.


Using DISM without Online Access

[Back to Top]

As mentioned earlier, DISM assumes the computer it is being run on has Internet access, but there may be times when you need to run it on a machine that doesn't have online access. You can achieve this by downloading what you need, saving it to a USB Flash Drive or similar, and then doing the following. 


Note: To complete all of the following steps, you will need a USB Thumb Drive or other portable USB Device with at least 8 GB of free space available.


Downloading the Windows 10 ISO

[Back to Top]

1.  On any other machine with Internet access, visit the following site;



From the above page, click the Download tool now button to download the MediaCreationTool1809.exe - At the time of writing this tutorial, the tool was at version 1809 - that number can change in the future as Windows 10 builds are updated. The file is small so won't take long to download.


2. Locate where you saved the MediaCreationTool1809.exe file and double click it to run it. Answer Yes to the User Account Control Prompt and then click the Run button.


3. A blue Windows 10 Setup window will open at which point you will need to click the Accept button to agree to the Microsoft Software License Terms


4. After waiting for a "Getting a few things ready" message, the following Window will appear. 


Select the "Create installation media (USB flash drive, DVD, or ISO file) for another PC" option and then click the Next button as shown below


Image showing Windows 10 Setup Window with two options. Upgrade this PC now and Create installation media (USB flash drive, DVD, or ISO file) for another PC. Select the Create installation media option and click the Next button.


5. Select the language and flavor (architecture) of Windows 10 you'll need to match what's installed on the machine you need to run DISM on. Ensure you "remove the tick" from the option to "Use the recommended options for this PC" as that is usually selected by default. 


Then click the Next button as shown below


Image showing options to Select Language, Edition and Architecture is available for selection. Remove the tick from Use the recommended options for this PC under the scenario that has been described and click the Next button.


Note: If unsure if you need to download 32-bit (x86) or 64-bit (x64), press the Windows Key and type System Information followed by your Enter key on the machine that needs repair. (The one you will be using this ISO on) The resulting window that pops up will identify which architecture you will need to select as "System Type"  The example below shows a 64-bit Windows installation.


System Information output snapshot showing System Type as being x64-based PC


6. After clicking Next above, select the radio button to "Create installation media (USB flash drive, DVD, or ISO file) for another PC" and click the Next button. 


Be sure not to miss this step as the tool will default "Upgrade this PC now" which is not what we want. See below


Image of the "What do you want to do" window with the options - Upgrade this PC now and Create installation media (USB flash drive, DVD, or ISO file) for another PC. Select the Create installation media option and then click the Next button.


7. You will now be prompted where to save the Windows.iso file that you need. Select your USB Stick or another portable External USB drive that you want to use. 


In the example below, I've selected a USB external drive with the drive letter F: and saving into a Temporary folder I created called Temp_Folder


Snapshot of Windows File Explorer showing the path where to save the Windows.iso file. Select desired location and click Save.


8. The tool will start to download and save the Windows.iso file for you to the location you've selected. A window showing the progress of the download will be displayed. It's quite a large file, so depending on your Internet speed, you'll need to be patient to allow the download to complete. 


Once the download has completed, click the Finish button to close the tool.


Note: Notice the tools says "Burn the ISO file to a DVD" which tends to confuse some people - you could click "Open DVD burner" if you wanted to use DVD media to save the ISO to, but that's not what we're going to use, so click the Finish button instead. See below


Snapshot showing Burn the ISO file to a DVD - just click the Finish button.


Mount Windows.ISO as a Virtual Drive

[Back to Top]

Back on the system that you want to repair that lacks any online access. Now that you have a Windows.iso file saved to your portable USB Device, plug the device into a USB port of the computer you want to repair. You will need to know the drive letter that Windows assigns to your USB device and the path on your device to where your Windows.iso file was saved.


It's now time to Mount the Windows.iso file as a virtual drive.


A quick and easy way to mount the Windows.iso file you downloaded as a virtual drive is to use Windows 10 File Explorer. 


Right-click the Windows.iso file in File Explorer from your USB device and select Mount


Windows will create a Virtual DVD Drive with the contents of the ISO. In the example below, it mounted as DVD Drive (E:) ESD-ISO - Your drive letter may differ.


Snapshot of Windows File Explorer showing Mounted ISO file contents


Open an Administrative Command Prompt as shown earlier, type the following command and press your Enter key to begin the repair.


  • DISM /Online /Cleanup-Image /RestoreHealth /Source:esd:E:\Sources\Install.esd /LimitAccess


DISM will now complete the operation using the files from the mounted Virtual DVD Drive (E: in this example) That is because we have told it to use the E: drive as the source and also specified that it should not try to access Windows Update with the /LimitAccess switch.


Snapshot of command window showing a completed successfully dialog after running the DISM command described above


Other DISM commands like /CheckHealth or /ScanHealth etc. can also be run in a similar fashion offline by using the above method and merely modifying the /switches passed to the command. To get a list of all available switches and options available for use with DISM, type the following in your command window


  • DISM /?


That command will return a whole host of information that you can also get further help on. For those of you that are technically minded, there is considerable information to be gleaned about DISM in the following Microsoft Help Article.



Concluding Remarks

[Back to Top]

If you have gone to the trouble of downloading a Windows 10 ISO file, store it somewhere for future use. You never know when it might come in handy again, such as for doing an in-place upgrade repair of Windows 10 if necessary. 


Also, now that you're done with the Virtual DVD Drive, right-click it in File Explorer and merely select "Eject" to free up the RAM it was using while active.


Other tutorials and articles I've written which are related to this topic where that saved Windows.ISO can be useful to have on hand can be viewed using the following links.


Other articles related to this topic


I hope this tutorial has taken some of the mystery out of the DISM command for you and has resulted in you being a bit more comfortable in using it to try and solve some Windows 10 OS problems. 


If you have any comments to share about any of the information presented here, I encourage you to leave a comment below or Ask a Question to get help from myself and other highly talented experts at Experts Exchange.


Finally, if you found this tutorial useful, or think it will be helpful to others, please do endorse it by clicking the Thumbs Up icon to the bottom left of this text.

[Back to Top]

Regards, Andrew Leniart


Graphics optimized with Alternate Text for blind and visually impaired readers.

7
2,333 Views
Andrew LeniartBlogger, Journalist, IT Professional, Tech Writer, Qualified Editor
CERTIFIED EXPERT
IT Professional - Helping others to help themselves. https://andrewleniart.com & https://www.computerhelpzone.com.au/testimonial/

Comments (1)

Basem KhawajaClinical Pharmacist

Commented:
Andrew,

I am more comfortable using this command thanks to you for sharing that information that is worthy to be placed in the Hall of Fame with the rest of all of your articles without a shadow of a doubt in my mind.

Thank you Andrew,

Basem Khawaja

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.

Get access with a 7-day free trial.
You Belong in the World's Smartest IT Community