Repair Windows

Published by TheBlogger on

Did you ever have to repair a Windows-computer? Sure you did. And sure you know the most used commands/options to repair (hopefully) a broken system.

  • SFC /Scannow (repairing System Files)
  • DISM /Cleanup-Image /RestoreHealth (repair components)
  • Netsh Int IP Reset (repairing Internet-connectivity)
  • Netsh Winsock Reset (repairing Internet-connectivity)

But what if these options did not work, and the system is still broken?? Then it’s time to grab the big guns 馃檪

DISM.exe is an excellent tool for repairing a broken system, because it can use an (already present) Install.image of the system to repair components, and that’s where the real power of DISM.exe is.

Most computers nowadays have a hidden partition with the original install-image on it. You can unhide such partition with the DiskPart-utility, and in this way making the install-image available to DISM. Then after unhiding and issueing a drive-letter to that partition, you can use the Image-file (Wim- or Esd-extension) to repair the system.

Before using such an Image, you will have to now with version the computer is running, and which Image-index from the Image-file you will have to use.

To get the OS-version, you can use the Powershell-command:
Get-ComputerInfo |select WindowsProductName, WindowsEditionId, WindowsVersion, OSDisplayVersion

To get the requested Image-index from the Image-file, use the Powershell-command:
Get-WindowsImage -ImagePath "D:\sources\install.wim" (where D: of course is the Drive-letter you assigned to the unhidden partition).

Then run the correct DISM-command (from an elevated prompt):

DISM /online /cleanup-image /restorehealth /source:WIM:D:\sources\install.wim:6
or:
DISM /online /cleanup-image /restorehealth /source:ESD:D:\sources\install.esd:6, depending whether the Image-file is a WIM-file or an ESD-file.

This will repair many broken systems.

Most information about this DISM-configuration/options did I find on http://woshub.com/dism-cleanup-image-restorehealth, which is an excellent in-depth description of all commands you can use.

Categories: Windows-tools