When the system file checker fails to repair corrupt Windows files, DISM /Online /Cleanup-Image /RestoreHealth command is used to address the issue. The Deployment Image Servicing and Management (DISM) tool in Windows, administrators use to Check Health of the Windows Image, Scan for Component Store Corruption, or Repair Windows Image. In short, the DISM restorehealth command is designed for administrators to prepare, modify, and repair system images, including Windows Recovery Environment, Windows Setup, and Windows PE (WinPE). This article explores the capabilities of the dism /online /cleanup-image /restorehealth command and how it can be used to repair a Windows 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 for some reason, windows system files get corrupted or missing it can lead to various issues on Windows PC. Such as you may experience frequent system crashes with blue screen errors, Windows freezes, not responding and it’s very slow. 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 scan with the appropriate parameters can help repair and restore the system files, resolving these issues.
Also, you can Run the DISM restore health command to fix Windows update problems, such as failed updates or update installation is stuck. It can repair the Windows image and ensure the proper functioning of the Windows Update service.
Repair Windows System Image using DISM Command
It’s important to note that running the DISM scan Command requires administrative privileges. Also, 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 explore Different DISM Command line options and How it can be used to Repair the Windows system image.
There are three main options you can use with DISM scan command 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 /CheckHealth
- DISM /Online /Cleanup-Image /ScanHealth
- DISM /Online /Cleanup-Image /RestoreHealth
Note: DISM /CheckHealth only determines any corruptions inside the system image, while /ScanHealth performs more advanced scan to find out whether the system image has any issues.
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 the command Bellow and hit the 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 images to identify any corruption or problems within the system.
- If detects 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 type Command Bellow and hit the Enter key.
Dism /Online /Cleanup-Image /RestoreHealth
Since the /restorehealth switch relies on Windows Update to provide repair files, ensure that the system has an active internet connection during the command’s execution.
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.
Note: Depending on the system’s configuration and the extent of corruption, the dism /online /cleanup-image /restorehealth command may take some time to complete. Be patient and avoid interrupting the process prematurely.
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 from 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.