DISM (Deployment Image & Servicing Management) is a command-line utility used to repair, and modify Windows images, Windows Setup, and Windows PE. Mostly DISM command line is used when sfc/scannow command is unable to repair corrupted or modified system files. If due to some reason, windows system files get corrupted and the system file checker fails to repair them, Run DISM Restore Health Command DISM /Online /Cleanup-Image /RestoreHealth Repair the System image And Enable System File Checker Utility To do its job. In this article, we will explore the capabilities of the DISM command and how it can be used to repair a Windows 10 image.
What is a Windows Image?
A Windows image is a compressed file that contains all the files, settings, and configurations required to install and run a Windows operating system.
When Need to Run the DISM Command line?
If due to some reason, windows system files get corrupted or missing it can lead to various issues on Windows 10. Such as you may experience frequent system crashes with blue screen errors, Windows freezes, not responding and it’s very slow. And running system file checker scan results Windows resource protection found corrupt files but was unable to fix some of them.
Run a DISM restore health Scan if SFC Can’t Repair Corrupt Files
Running the DISM command with the appropriate parameters can help repair and restore the system files, resolving these issues.
Also, you can Run the DISM command to fix Windows update problems, such as failed updates or update installation stuck. It can repair the Windows image and ensure the proper functioning of the Windows Update service.
The command can be used to mount, modify, and unmount Windows images, allowing customization and configuration of the image before deploying it to multiple machines.
Repair Windows System Image using DISM Command
It’s important to note that running the DISM Command-line utility requires administrative privileges, and it’s recommended to create a system restore point or backup before making any changes to the Windows image. So that in case things go wrong, and you need to revert back the changes.
Ensure your device is connected to a stable and working internet connection as DISM uses Windows updates as a Source to repair the system image.
Now Let’s discuss Different DISM Command line options and How To Run the DISM Command line to Repair the Windows system image and enable the SFC utility To do its job.
There are three main options you can use with DISM to repair the Windows image on your computer, including CheckHealth, ScanHealth, and RestoreHealh.
Press Windows key + S and type cmd, Right-click on the command prompt and select run as administrator. And you can run the following DISM commands.
- DISM /Online /Cleanup-Image /ScanHealth
- DISM /Online /Cleanup-Image /RestoreHealth
DISM ScanHealth Command
DISM Command-line With /ScanHealth Switch checks for component store corruption and records that corruption to the C:\Windows\Logs\CBS\CBS.log but no corruption is fixed or repaired using this switch. This is useful for logging what if any, corruption exists.
Here’s what the DISM /ScanHealth command does:
- Scan the Windows image to detect any corruption, missing files, or other issues that may exist within the system.
- Verifies the integrity of the component store, which is a repository of Windows system files located in the %WinDir%\WinSxS folder.
- Generates a report that indicates whether any corruption or problems were found in the Windows image.
To Run the command open the Command prompt As administrator Then Type command Bellow and hit Enter key.
Dism /Online /Cleanup-Image /ScanHealth
This will start the scanning process for system image corruption This could take 10-15 minutes.
DISM RestoreHealth Command
The DISM command with the /RestoreHealth switch scans the Windows image for any corruption and performs repair automatically. This operation takes 15 mins or more depending on the level of corruption.
Here’s what the DISM /RestoreHealth command does:
- Initiates a scan of Windows image to identify any corruption or problems within the system.
- If detect corrupt files, it tries to retrieve the necessary files from Windows Update to repair the image automatically.
- DISM command attempts to repair the Windows image by replacing the corrupted or missing files with the correct versions from the source.
To Run, the DISM RestoreHealth command open the Administrator command prompt and type Command Bellow and hit the Enter key.
Dism /Online /Cleanup-Image /RestoreHealth
The above command will try to use Windows Update to replace the damaged files. This process takes a long time to complete. If the problem has also extended to the Windows Update components, then you’ll need to specify a source containing the known good files to repair the image.
Run DISM command with Source options
Usually, when you run DISM /RestoreHealth command it it will attempt to retrieve the required files from Windows Update to repair the system image. This requires an active internet connection.
But If an internet connection is not available or the required files cannot be retrieved from Windows Update, You can use a local Windows installation media (such as a DVD or USB) as the repair source.
To Run DISM with Source options first Download Windows 10 ISO, 32 Bit, Or 64 Bit with the same version and edition of your current version of Windows 10. After completing, the Download process Right Click The ISO File, Select Mount, and Note down the Drive path.
Now-Again open the Command prompt As administrator then Type the command
DISM /Online /Cleanup-Image /RestoreHealth /source:D:\Sources\Install.wim /LimitAccess
Note: Replace D with the letter drive on which your Windows 10 ISO is mounted.
This will perform a Windows image repair using the known good files included within the install.wim file using the Windows 10 installation media, without trying to use Windows Update as a source to download the required files for repair.
Wait until 100% complete the Scanning Process. Once the process is complete, DISM will create a log file in %windir%/Logs/CBS/CBS.log and capture any issues that the tool finds or fixes. After that Restart your computer to take Fresh Start.
Run System File Checker Utility
Now, After run the DISM (Deployment Imaging and Servicing Management) Tool, it will repair those corrupted files that sfc/scannow command is unable to modify the issues at a later time.
Now again open the Command prompt As administrator and type Command sfc /scannow hit enter key to run System file checker Utility. This will check and repair Missing corrupted system files.
This Time System file checker Utility will Successfully scan and Restore the missing, Damaged corrupted system files with a Good Copy form a special Cache folder Located on %WinDir%\System32\dllcache.
Wait until 100% complete the scanning and repairing process. After that Restart the Windows computer. That’s all now you have successfully Repaired missing corrupted system files using the SFC utility or Repair system image Running the DISM Command line tool.