Learn how to use the DISM command in Windows 10 and Windows 11 to troubleshoot and fix common issues with your Windows operating system and key system files. Follow our step-by-step guide to learn all about System File Checker (SFC), DISM, and to gain some knowledge about what your ‘local Windows image’ is.
DISM stands for Deployment Image Servicing and Management. This is a command-line tool used to create, modify, or repair system images, including Windows 10 and Windows 11. It is used for various types of Windows system images including the Windows Recovery Environment, Windows Setup, and Windows PE (WinPE). The system image is referenced whenever routine checks on system files are performed. There are a few utilities included in Windows that allow you to scan your system for any potential data corruption.
Let me explain how this works in the next section.
There are two main command-line utilities included in Windows to scan the local system for any corruption of key system files. These include all the files to maintain Windows and its robustness. These utilities are often used as a first step in troubleshooting general issues with Windows.
If your Windows system is having trouble booting or if you’re trying to resolve a specific error, you can try the SFC command tool. The System File Checker will scan the integrity of all protected system files and replace incorrect versions with correct Microsoft versions. It uses relied-upon images on the local system (more on this in a moment).
Let me show you how it works. Open an administrative command prompt and run the following command:
sfc /scannow
Well, look at that. It found corrupt files and repaired them. You’ll see the corresponding CBS.LOG file in the screenshot above which shows detailed steps the utility took to complete the scan and repairs. And don’t worry too much about the fact that it found corruption. It’s a little more commonplace than you may think.
The SFC utility above used the local image (install.wim) to copy the repaired files back into Windows. But what happens if that local image is damaged or corrupted in some way? This is where DISM comes to save the day. If the System File Checker reports problems with the local image, you can use DISM to make repairs to the local images, most often from online repositories. Let me go through the process next.
The DISM tool includes three main switches that can help you repair a system image. These are:
You will want to make sure you use them in this order. Let’s first ‘check the health’ of our image below.
The first switch is to check the health of an image, completely non-destructive. Think of it as a ‘read-only’ phase. Open your administrative command prompt, or Windows Terminal to run this command and press Enter.
DISM /online /Cleanup-image /Checkhealth
Well, piece of cake. As you can see, we’re good. Let’s move on to the next one.
This is a little more robust. It performs a more advanced scan to dig deeper into the image itself to find any issues. Please run this command to initiate the scan.
DISM /online /Cleanup-image /ScanHealth
On my rather basic Windows 10 VM in my Hyper-V lab, this command took about 4 minutes to complete.
There, everything is looking very good. Still 10 for 10.
Because no corruption was detected, the next command will likely be nice and swift. However, for completeness, the ‘RestoreHealth’ switch is used to repair issues with your local image. If any corruption or missing files are detected, DISM will connect to ‘Windows Update’ and download any needed files from a trusted source online.
Run this command to attempt repairs to the image.
DISM /online /Cleanup-image /Restorehealth
Again, a nice clean system. Obviously, on a fairly ‘worn’ system with multiple application installs, repairs, uninstalls, etc. you are bound to find items that need repairing. This is the most trustworthy solution in your arsenal if you hope to avoid re-imaging your machine.
Another scenario that the DISM tool helps is when you encounter component store corruption. The component store on a Windows system is the C:\Windows\WinSxS folder. 99% of the time you want to leave this alone, as it is critical to keep Windows running. You can look into additional options related to the ‘/Cleanup-image’ switch to repair this corruption.
So, what do you do if the command experiences issues with repairing files? What if the computer you’re attempting repairs on is not connected to the Internet (network)? You need to adjust your tactics by downloading, on another computer, a fresh, trusted Windows 10 ISO file. Let me show you how.
The first step is download the Media Creation Tool from Microsoft’s download servers. This tool lets you create installation media from a central trusted source.
You can start here on the ‘Download Windows 10’ website. Under ‘Create Windows 10 installation media‘, click the ‘Download Now‘ button to download the tool.
After downloading the file, we’ll move into running it!
In your Downloads folder, double-click on the ‘MediaCreationTool_22H2.exe‘ file.
You can agree to the license terms and click Accept.
On the ‘What do you want to do?‘ page, choose the second option – ‘Create installation media (USB flash drive, DVD, or ISO file) for another PC‘.
The next screen asks you to choose the Language, Edition, and Architecture. Make your choices and click Next.
On the ‘Choose which media to use’ screen, choose the second option again, ‘ISO file.’
The tool will then open a standard Windows ‘browse’ window and ask you where you want to save the ISO file it will download. I chose the Downloads folder and kept the default filename, Windows.ISO.
The file will now be downloaded from Microsoft online servers. After the download completes, it will verify the file and save the ISO file where you specified.
There, it finished and there’s the file.
Now that we have a known-good image file (the windows.iso file we downloaded), we have the option to repair the health of our local image using this certified file. Here are the steps you can use to complete the repairs when you run into this situation.
First, right-click on the windows.iso file and click Mount. This will ‘open’ the ISO file and allow Windows to access it as if a Windows installation DVD was inserted into a local DVD drive. Note the drive letter assigned to it (mine is E:).
Then, run this command to run DISM with the ‘/RestoreHealth’ switch using our new ISO file.
DISM /online /Cleanup-image /Restorehealth /Source:E:\sources\install.wim
You have the option to limit the use of Windows Update when using the ‘/RestoreHealth’ option. If you also add the ‘/Limitaccess’ switch, the tool won’t go out to Windows Update to check for files, it will only use your local source file (ISO).
The DISM command is an indispensable tool in Windows 10/11, especially for IT Pros and admins. We are given a robust set of tools and switches to bring back these systems to life, saving hours from re-imaging, re-installing applications, etc.
One quick note – although the potential repairs made by the tool are nearly always non-destructive, it is still a good idea to make a full system backup before performing these steps.
Thank you for reading. If you have any comments or questions, please leave a note in the comments below!