What Is DISM and How Do I Use It?

Reading Time: 8 minutes

We will go over all the specifics later but the short answer – DISM is a Microsoft Command Line tool that was designed to allow administration of the ‘Nuts and Bolts’ of the Operating System Image itself.

  • DISM /Online /Cleanup-Image /CheckHealth
  • DISM /Online /Cleanup-Image /ScanHealth
  • DISM /Online /Cleanup-Image /RestoreHealth
  • Keep Reading to learn more

If you are finding this on Google then you are more than likely trying to run the DISM command and are looking for the strings to enter into an elevated command prompt. We got chu – but – we also have a lot more information on DISM, what it is and how it might help you.

First A Little History

It all started with Windows 7 and Windows Server 2008 R2 and a change in direction from Microsoft on how to properly deprecate ImageX, how to address the growth of WIM and Virtual Images as well as how to include some additional features that may be beneficial to admins and end users alike.

“Deployment Image Servicing and Management (DISM.exe) mounts a Windows image (.wim) file or virtual hard disk (.vhd or .vhdx) for servicing. You can also use the DISM image management command to list the image index numbers, to verify the architecture for the image that you are mounting, append an image, apply an image, capture an image and delete an image. ”

Microsoft

By utilizing DISM one can mount and then service a Windows image from the following file formats.

  • .wim
  • .ffu
  • .vhd
  • .vhdx

DISM can be used with older Windows image files although it cannot be used with images that are more recent than the installed version of DISM.

If you are looking to learn more about WIM from a technical standpoint, please visit Microsoft’s site Windows Imaging File Format (WIM) white paper.

DISM can be used to service Windows images starting with Windows 7, Windows Server 2008 R2, and their associated versions of WinPE and WinRE. The commands and options that are available for servicing an image depend on which Windows operating system you are servicing, and whether the image is offline or a currently running operating system.

When Would I Use DISM?

When your computer is facing issues with start up, performance or ‘unexpected’ errors – one of the first things in the tool box is the good old System File Checker ( sfc /scannow ) which will detect and replace any corrupted or missing files on the local image.

Although – there are times when the issue resides deeper within the image that the SFC just can’t repair. In these situations, the next best option is to use DISM to attempt to repair the underlying issue.

There are a few scenarios where DISM can be best utilized as outlined per Microsoft.

  • Managing the data or information included in the Windows image, such as enumerating or taking an inventory of the components, updates, drivers, or applications that are contained in an image, capturing or splitting an image, appending or deleting images within a .wim file, or mounting an image.
  • Servicing the image itself, including adding or removing driver packages and drivers, modifying language settings, enabling or disabling Windows features, and upgrading to a higher edition of Windows.

Basically – Information gathering, upgrade and repair.

What’s New With DISM In Windows 10?

DISM in Windows 10 supports new features:

  • Full Flash Update (.FFU): DISM supports the Full Flash Update (.FFU) format, which captures an applies an entire drive, including partition information. This can make deployment faster and easier. See Windows full flash update images for more info.
  • Capabilities: This new Windows package type allows you to request services like .NET or languages without specifying the version. Use DISM to search multiple sources like Windows Update or your corporate servers to find and install the latest version. For more info, see Features on Demand.
  • Compress operating system and provisioning packages: Save space on a Windows image by running the operating system and other system files from compressed files. This replaces the WIMBoot features from Windows 8.1. See /Apply-Image /Compact and /Apply-CustomDataImage in DISM Image Management Command-Line Options for more info.

Okay, Enough Background. Lets Go Through The Steps

For the simplicity of this guide we will be using an elevated command prompt window ( cmd.exe ) focusing on 3 of the most common tasks DISM can be used for. Yes this can be accomplished through PowerShell and yes there are a number of arguments we will not be using but we will include them near the end of this tutorial.

When using the Deployment Image Servicing and Management ( DISM ) tool there are 3 major commands we will run. Processing these in order, CheckHealth, ScanHealth and RestoreHealth will scan, identify and repair any corruptions found.

The RestoreHealth option does have a number of additional arguments that can be used to utilize an image from a different source.

Checking issues with DISM using CheckHealth option

CheckHealth is the option within DISM to quickly scan and identify if there are any perceived corruptions within the local image. This function only processes the initial scan and reports on findings – No repairs are made with CheckHealth

To check for issues within the image with DISM, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to perform a quick health check and press Enter: DISM /Online /Cleanup-Image /CheckHealth

If there are any corruptions identified, it will be listed at the end of this process.

Checking issues with DISM using ScanHealth option

Alternatively, you can run DISM with the ScanHealth option to perform a more in depth scan to check if the Windows 10 image has any problems. This function only processes the initial scan and reports on findings – No repairs are made with ScanHealth

To perform an advanced scan with DISM, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to perform an advanced DISM scan and press Enter: DISM /Online /Cleanup-Image /ScanHealth

This process will take longer to process than the CheckHealth option but will also have a higher chance of identifying issues.

Repairing issues with DISM using RestoreHealth option

If any issues are identified, proceed to the below steps to use RestoreHealth to scan and repair any problems automatically.

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command and press Enter: DISM /Online /Cleanup-Image /RestoreHealth

After processing these steps, the Deployment Image Servicing and Management tool ( DISM ) will then connect to the Windows Update servers to download and replace and any damaged files on the local image.

What about those Arguments?

Syntax:

DISM.exe /Append-Image /ImageFile: /CaptureDir: /Name: [/Description:] [/ConfigFile:] [/Bootable] /WIMBoot [/CheckIntegrity] [/Verify] [/NoRpFix]
/WIMBootUse /WIMBoot to append the image with Windows image file boot (WIMBoot) configuration. This only applies to Windows 8.1 images that have been captured or exported as a WIMBoot file. This feature isn’t supported in Windows 10.
/ConfigFilespecifies the location of a configuration file that lists exclusions for image capture and compress commands. For more information, see DISM Configuration List and WimScript.ini Files.
/BootableMarks a volume image as being a bootable image. This argument is available only for Windows Preinstallation Environment (WinPE) images. Only one volume image can be marked as bootable in a .wim file.
/CheckIntegrityDetects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.
/VerifyChecks for errors and file duplication.
/NoRpFixDisables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system. If /NoRpFix is not specified, reparse points that resolve to paths outside of the value specified by /ImageFile will not be captured.
/CheckIntegrityDetects and tracks .wim file corruption when used with capture, unmount, export, and commit operations. /CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with apply and mount operations.
/VerifyChecks for errors and file duplication.
/NoRpFixDisables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system. If /NoRpFix is not specified, reparse points that resolve to paths outside the value specified by /ImageFile will not be captured.
/SWMFileEnables you to reference split .wim files (SWMs). Pattern is the naming pattern and location of split files. Use a wildcard character when specifying the naming pattern. For example, “E:\image\install*.swm” will apply all of the split files in the E:\image directory named install1.swm, install2.swm, and so on.
/ConfirmTrustedFileValidates the image for Trusted Desktop on a Windows 10, Windows 8.1, or Windows 8. This option can only be run on a computer running at least WinPE 4.0. When using /Apply-Image with the /ConfirmTrustedFile option in WinPE, always specify the /ScratchDir option pointed to a physical media location. This ensures that short file names will always be available. See DISM Global Options for Command-Line Syntax for more information about the default behavior of the /ScratchDir option. Beginning with Windows 10, version 1607, you can use /EA to apply extended attributes.
/WIMBootUse /WIMBoot to append the image with Windows image file boot (WIMBoot) configuration. This only applies to Windows 8.1 images that have been captured or exported as a WIMBoot file. This feature isn’t supported in Windows 10.
/CompactApplies an image in compact mode, saving drive space. Replaces WIMBoot. For Windows 10 for desktop editions (Home, Pro, Enterprise, and Education) only.

Note: If you’re applying an image in compact mode with the /ScratchDir option, make sure your ScratchDir folder is not on a FAT32-formatted partition. Using a FAT32 partition could result in unexpected reboots during OOBE.
/EANew in Windows 10, version 1607. Applies extended attributes.
/ApplyDriveSpecifies the logical drive, using the DeviceID. to get the device ID from the command line, type “wmic diskdrive list brief”. Note: a VHD may appear with the name “PhysicalDrive” in the description, for example, .\PhysicalDrive2.
/SFUFileUse /SFUFile to reference split FFU files (SFUs). Pattern is the naming pattern and location of split files.

For a full listing of arguments and more detailed information on each check out Microsoft’s DISM Image Management Command-Line Options

If you found this tutorial helpful please comment and share with your friends, family and colleagues.

Leave a Reply

Your email address will not be published. Required fields are marked *

https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js