Wednesday, April 22, 2015

Checking and Restoring Windows Images

Deployment Image Servicing and Management tool (DSIM) is a command-line tool used to install, uninstall, configure, and update Windows features, packages, drivers, and international settings primarily on Windows images offline before deployment. Some DISM servicing commands are also available for running operating systems. The basic syntax for dism is (in a single line),

DISM.exe {/Image:<path_to_image> | /Online} [dism_options] 
                         {servicing_command} [<servicing_argument>]

That is to day, for servicing a Windows image offline, the syntax is,

DISM.exe /Image:<path_to_image> {servicing_command} [<servicing_argument>]
and for servicing a running Windows operating system, the syntax is,

DISM.exe /Online [dism_options] {servicing_command} [<servicing_argument>]
For instance, to service a running Windows, we can use /Cleanup-Image servicing command to perform cleanup and recovery operations on the image, which are commonly called for to deal with corrupted windows system.
  • Use servicing argument /CheckHealth to check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired.
  • Use servicing argument /ScanHealth to scan the image for component store corruption.
  • Use servicing argument /RestoreHealth to scan the image for component store corruption, and then perform repair operations automatically.
More concretely, we can run the following commands from Windows Command Prompt with elevated permission,

Dism.exe /Online /Cleanup-Image /ScanHealth

Dism.exe /Online /Cleanup-Image /CheckHealth

Dism.exe /Online /Cleanup-Image /RestoreHealth

Alternatively, from Windows Powershell, run,

Repair-WindowsImage -Online -CheckHealth

Repair-WindowsImage -Online -ScanHealth

Repair-WindowsImage -Online -RestoreHealth

No comments:

Post a Comment