Whether you have a great gaming PC, one of the best laptops, or even a mini PC, Windows will always find a way to give you unexpected errors. There are many ways to fix these random problems, but DISM (Deployment Image Servicing and Management) commands are unknown to most people. System administrators regularly use DISM to configure, optimize, and repair system images.
However, you don't need an IT degree to use these helpful commands to solve a variety of system problems. They're easy to use and can sometimes even help fix a Windows BOSD. Here's how these commands work and how you can use them in different ways.
What is DISM?
A helpful command line tool
If you're interested in a more technical understanding of DISM, here's the bottom line: DISM works primarily by managing data contained in the Windows image. This image is a compressed representation of the Windows operating system, including system files, boot configuration, and drivers.
DISM helps to account for updates, drivers, applications, and corrupted files in this Windows image. It can be used to check the system health, look for serious problems, and repair corrupted files. This command tool can be used with several options such as: Health check, ScanHealthAnd RestoreHealthWe will address all of these points in the respective sections.
Using DISM commands will not delete your data or programs, but we recommend that you back up Windows because you will be making system changes.
Checking system integrity with DISM
Just a general investigation
This is the most basic command you can use with DISM. The DISM Health check The command looks for file corruption in the local Windows image. Think of it as a diagnostic tool that helps you troubleshoot potential problems and their causes. Remember that it doesn't fix the problems itself, it just identifies them.
1. In the Start menu, search for Command prompt.
2. Right-click on the first result and select Run as administrator.
3. Type or copy/paste the following command and then press Input.
DISM /Online /Cleanup-Image /CheckHealth
After you press Enter, the DISM tool will execute the Health check command and check for data corruption in the local image. If the command does not find any problems, it will display:No component store corruption was detected.” On the other hand, if it finds adulteration, it will say “The stored component was corrupted.”
Advanced system image scan with DISM
Check for deeper problems
The CheckHealth option is a good first diagnostic tool. ScanHealth performs an advanced scan that looks deeper for corruption in the component store. It also saves the report to a log file. Here's how you can use the option:
1. In the Start menu, search for Command prompt.
2. Right-click on the first result and select Run as administrator.
3. Type or copy/paste the following command and then press Input.
DISM /Online /Cleanup-Image /ScanHealth
This process takes a little longer than the Health check command. You should see a progress bar indicating the percentage of completion. If any problems are detected after the scan is complete, you can RestoreHealth Command to repair Windows image.
Repair the Windows system image
Helpful for BSODs and data corruption
If after running Health check or ScanHealth health commands, your next step is to execute the RestoreHealth command. This command uses Windows Update to find and deliver the necessary files to fix file corruption. It repairs the Windows 11 system image, but requires an internet connection.
1. In the Start menu, search for Command prompt.
2. Right-click on the first result and select Run as administrator.
3. Type or copy/paste the following command and then press Enter.
DISM /Online /Cleanup-Image /RestoreHealth
This process takes a little longer than the Health check command. You should see a progress bar indicating the progress percentage. The RestoreHealth The command should help repair the Windows image.
Convenient if you don't have internet access
If your computer is not connected to the Internet or the Windows Update component itself is corrupted, RestoreHealth can't do much on its own. Fortunately, you can mount a Windows ISO or use Windows installation media to repair the system image.
To do this, you must first create the ISO file using the Media Creation Tool. Do not run the setup process after creating the ISO file. Instead, follow the steps below.
1. Double-click the ISO file in the folder you saved it to earlier. This will mount it on your DVD drive. Make note of the letter assigned to the drive. In our case, the drive letter is “D:“.
2. In the Start menu, search for Command prompt Right-click again and select Run as administrator.
3. Type or copy/paste the following command and press Enter. Make sure to type “D:” with the drive letter of your own Windows ISO file.
DISM /Online /Cleanup-Image /RestoreHealth /Source:D:\Sources\install.wim
This is the longest process so far. The command scans and fixes problems using the install.wim file in the Windows installation media.
Repair Windows installation using SFC utility
Scan and replace corrupted files with the installation
The DISM commands you used above focus on repairing the system image and source files, not the actual installed copy. After you fix problems with the system image, you can use the System File Checker (SFC) command tool to fix any problems with your Windows 10 or 11 installation. It is highly recommended that you run an SFC scan almost every time you use DISM image repair commands.
1. In the Start menu, search for Command prompt.
2. Right-click on the first result and select Run as administrator.
3. Type or copy/paste the following command and then press Enter.
SFC /scannow
After running the above command, the System File Checker utility will start checking the integrity of the system files to see if they are corrupted. If the Command Prompt stops responding, press Enter on your keyboard several times to refresh the window.
Using DISM and SFC commands
Both the DISM and SFC commands make it easy to scan and repair problems with corrupted files. While using the Command Prompt may seem technical to some people, it's as simple as finding the right commands and copying/pasting them into the Terminal. However, if your problem is more related to performance than Windows itself, check out our guide on how to fix performance issues on Windows 11.