Skip to main content

Repair Windows

There are several ways to repair Windows when corrupt. Running sfc /scannow is a good start. If this does not repair then you can try the DISM tool. A good article about the DISM tool can be found here: 

 

http://www.windowscentral.com/how-use-dism-command-line-utility-repair-windows-10-image 

 

 

<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=220642544984887&ev=PageView&noscript=1"/>  

Before you begin 

It's important to note that you'll be making changes to your computer, as such it's recommended to do a full backup or create a system restore point in case things go wrong, and you need to rollback the changes. 

How to run DISM commands to fix Windows 10 

There are three main options you can use with DISM to repair the Windows image on your computer, including CheckHealth, ScanHealth, and RestoreHealh -- and you want to use them in this order. 

Using DISM with the CheckHealth option 

Use the DISM command with the /CheckHealth switch to verify whether any corruption has been detected. This command can only be used to see if corruption exists, but it doesn't perform any repairs. 

To run the command do the following: 

  1. Use the Windows key + X keyboard shortcut to open the Power User menu and select Command Prompt (Admin). 

  2. Type the following command and press Enter: 
    DISM /Online /Cleanup-Image /CheckHealth 

Using DISM with the ScanHealth option 

Use the DISM command with the /ScanHealth switch to scan the Windows image for any corruption. Unlike the /CheckHealth, the /ScanHealth witch can take up to 10 minutes to complete the process. 

To run the command do the following: 

  1. Use the Windows key + X keyboard shortcut to open the Power User menu and select Command Prompt (Admin). 

  2. Type the following command and press Enter: 
    DISM /Online /Cleanup-Image /ScanHealth 

Using DISM with the RestoreHearlh option 

Use the DISM command with the /RestoreHealth switch to scan the Windows image for any corruption and to perform a repair automatically. Unlike the /ScanHealth switch, the /RestoreHealth switch can take up to 20 minutes to complete the process. 

To run the command do the following: 

  1. Use the Windows key + X keyboard shortcut to open the Power User menu and select Command Prompt (Admin). 

  2. Type the following command and press Enter: 
    DISM /Online /Cleanup-Image /RestoreHealth 

Note: While the running DISM using the /RestoreHealth or /ScanHealth, you will notice the process will seem stuck at 20% or 40%, but it's normal behavior. After a few minutes, the operation will finish as expected. 

When you run the command mentioned above, DISM will try to use Windows Update to replace the damaged files. However, 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. 

Using DISM with the RestoreHearlh and Source options 

You can specify a new location for the known good files by using the /Source switch alongside /RestoreHealth. 

Before you can use the repair commands, you will either need a copy of the install.wim file from another computer, a Windows 10 installation media, or the Windows 10 ISO file. It's also very important that the source of the known good files matches the same version, edition, and language of the operating system you're using. 

You can download the ISO for Windows 10 using these instructions: 

  1. Visit the Microsoft Windows 10 download page. 

  2. Click the Download tool now button. 

  3. Double-click the file to run the Media Creation Tool. 

  4. Follow the on-screen directions to create an ISO file with the same version and edition of your current version of Windows 10. 

  5. Once the process completes, double-click the file to mount the ISO, and note the drive letter as you'll need it set the source path. 

Note: If you come across any issues using the ISO using the Media Creation Tool, you can try downloading the Windows 10 installation files from the Microsoft's Tech Bench Upgrade Program site. 

Now you are ready to run the command to fix the Windows image: 

  1. Use the Windows key + X keyboard shortcut to open the Power User menu and select Command Prompt (Admin). 

  2. Type the following command and press Enter: 
    DISM /Online /Cleanup-Image /RestoreHealth /Source:repairSource\install.wim 

Or you can also run the following to limit the use of Windows Update: 
DISM /Online /Cleanup-Image /RestoreHealth /Source:repairSource\install.wim /LimitAccess 

Alternatively, you can also use following variant of the previous command to accomplish the same task: 
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:repairSource\install.wim:1 /LimitAccess 

Note: Remember to replace "repairSource" for the path to the source with known good files. For example, D:\Sources\install.wim. 

The command will perform a Windows image repair using the known good files included within the install.wim file using the Windows 10 installation media, and without trying to use Windows Update as a source to download the required files for repair. 

Using DISM with an install.ESD file 

Alternatively, you can not only specify a source pointing to install.WIM, but you can also use an install.ESD file, which is an encrypted version of Windows image. 

If you have upgraded to Windows 10 from a previous version of the operating system, the installation files may still stored on the C: drive, which means that you may just have a source of known good files. 

To use the install.esd to repair the Windows image in your computer use the following steps: 

  1. Use the Windows key + X keyboard shortcut to open the Power User menu and select Command Prompt (Admin). 

  2. Type the following command and press Enter: 
    DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\$Windows.~BT\Sources\Install.esd 
    Or you can also run the following to limit the use of Windows Update: 
    DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\$Windows.~BT\Sources\Install.esd /LimitAccess 
    Alternatively, you can also use following variant of the previous command to accomplish the same task: 
    DISM /Online /Cleanup-Image /RestoreHealth /Source:esd:C:\$Windows.~BT\Sources\Install.esd:1 /LimitAccess 
    Or if the install.esd is located on another drive use the following command: 
    DISM /Online /Cleanup-Image /RestoreHealth /Source:repairSource\Install.esd 

Note: Remember to replace "repairSource" for the path to the source with known good files. For example, D:\Sources\install.esd. 

The Deployment Image Servicing and Management (DISM) utility will always create a log file at %windir%/Logs/CBS/CBS.log capturing any problems the command-line utility fixed or found. 

How to repair Windows 10 problems 

The instructions you've learned thus far are to repair the Windows image. Now you can use the Windows image to fix the problems in your Windows 10 installation using the System File Checker (SFC) utility. 

  1. Use the Windows key + X keyboard shortcut to open the Power User menu and select Command Prompt (Admin). 

  2. In the Command Prompt type the following command and press Enter: 
    sfc /scannow 

 

From <http://www.windowscentral.com/how-use-dism-command-line-utility-repair-windows-10-image