Windows includes a built-in tool called Deployment Image Servicing and Management (DISM), which helps scan and repair corrupted system files and restore system stability when encountering errors or problems running applications and installing updates.

According to a report published by Engadget, there are three essential commands in the DISM tool that can be used to scan and repair Windows system images. They work through Command Prompt or PowerShell, both of which must be run with administrator privileges.

First Command: `DISM /Online /Cleanup-Image /CheckHealth`

This command checks whether Windows has previously detected corrupted system files and determines whether they can be repaired. It is a suitable first step because it does not take much time.

Second Command: `DISM /Online /Cleanup-Image /ScanHealth`

This command performs a new scan of system files and the Component Store, providing a report on their condition and any problems detected. The process may take several minutes.

Third Command: `DISM /Online /Cleanup-Image /RestoreHealth`

This command scans for corrupted system files and attempts to repair them automatically, obtaining the necessary files through Windows Update by default.

What Should You Do If DISM Fails to Repair the System?

If DISM cannot obtain the repair files because of problems with Windows Update, an official Windows ISO file can be used as an alternative source.

This requires downloading the ISO file from Microsoft's website, mounting it, and checking the Windows edition and index number before running the RestoreHealth command and specifying the installation files' location as the repair source.

Once the process is complete, it is advisable to run the `sfc /scannow` command to repair corrupted or missing system files.

Microsoft recommends using DISM before the System File Checker (SFC) tool because DISM repairs the Windows Component Store, which SFC relies on to obtain healthy files and replace corrupted ones.