DISM

Also known as: Deployment Image Servicing and Management

On this page 7

DISM, short for Deployment Image Servicing and Management, is the Windows command-line tool that inspects, modifies and repairs Windows images, either the running operating system or an offline image stored in a WIM, ESD, VHD or VHDX file. It adds and removes packages, drivers, optional features and capabilities, captures and applies images, and repairs a damaged component store.

In the PowerShell & command line toolkit for Windows administration, DISM is the servicing engine behind deployment and repair. It runs as dism.exe from an elevated Command Prompt or PowerShell session, and the same functions are exposed as cmdlets in the built-in DISM PowerShell module. It replaced several older tools, including Package Manager and PEimg, starting with Windows 7 and Windows Server 2008 R2.

How DISM services online and offline images

DISM always works against a target image, and the first choice in any command is which image that is. The /Online switch targets the currently running installation, while /Image:<path> targets an offline Windows directory, typically a WIM file mounted into an empty folder. Offline servicing changes a reference image before deployment, so every device built from it inherits the change.

Under the hood, DISM calls the Component-Based Servicing stack, the same engine that Windows Update uses. Packages land in the WinSxS component store, and DISM records each operation in C:\Windows\Logs\DISM\dism.log, with deeper servicing detail in CBS.log. A mounted image stays locked until it is unmounted with either /Commit to save changes or /Discard to drop them.

The table below lists the image formats DISM handles and their typical role.

FormatDescriptionTypical use
WIMFile-based image with single-instance storageReference images and installation media
ESDHighly compressed, often encrypted WIM variantWindows Update and media downloads
VHD and VHDXVirtual hard disk containing a full volumeVirtual machines and native boot
FFUSector-based full flash update imageFast factory deployment of whole disks
Online systemThe running Windows installationRepair and feature changes in place
Image formats serviced by DISM

Essential DISM commands and options

DISM commands follow a verb-noun switch syntax such as /Get-Features or /Add-Driver, each combined with the target switch. The following table groups the commands administrators use most often.

CommandPurposeExample context
/Get-ImageInfoLists the indexes and editions in an imagePicking the right index to mount
/Mount-ImageMounts an image index to a folderOffline servicing of a reference image
/Add-PackageInstalls a CAB or MSU updateSlipstreaming cumulative updates
/Add-DriverInjects INF-based driversStorage or network drivers for new hardware
/Enable-FeatureTurns on an optional featureAdding .NET Framework 3.5 or Hyper-V
/Add-CapabilityInstalls a Feature on DemandLanguage packs or RSAT tools
/Cleanup-ImageChecks, repairs and trims the component storeFixing failed Windows updates
/Capture-Image and /Apply-ImageCreates or deploys a WIM from a volumeCustom deployment without a full toolkit
Frequently used DISM commands

Most commands accept helpful modifiers. /LimitAccess stops DISM from contacting Windows Update, /Source points to local repair files, /Recurse adds every driver in a folder tree, and /Quiet with /NoRestart makes DISM suitable for unattended scripts.

Repairing Windows with DISM and System File Checker

DISM repairs the component store, while System File Checker repairs protected system files from that store, so the two tools are used in a fixed order. If the store itself is corrupt, sfc /scannow copies damaged files from a damaged source, which is why administrators run DISM first and SFC second.

The three health options of /Cleanup-Image differ greatly in depth and duration, as the next table shows.

OptionWhat it doesTypical duration
/CheckHealthReads the corruption flag already recordedSeconds
/ScanHealthScans the store for corruption without fixing itSeveral minutes
/RestoreHealthScans and replaces damaged componentsTen minutes to over an hour
/StartComponentCleanupRemoves superseded component versionsMinutes, depending on store size
/ResetBaseMakes current updates permanent and frees spaceMinutes; updates cannot be uninstalled
Component store health options

By default, /RestoreHealth downloads replacement files from Windows Update. On isolated networks, administrators supply a matching source, for example /Source:wim:D:\sources\install.wim:1 /LimitAccess. The source must match the build and edition of the damaged system, or the repair fails with a source-files-not-found error.

DISM overlaps with several neighbors in the Windows command line, but each tool owns a distinct layer. The table below separates their responsibilities.

ToolMain responsibilityRelationship to DISM
DISMServicing and repairing Windows imagesRepairs the component store
System File CheckerVerifying protected system filesDepends on a healthy component store
DISM PowerShell moduleObject-based access to the same functionsCmdlets such as Repair-WindowsImage
diskpartCreating and formatting partitionsPrepares volumes before Apply-Image
wingetInstalling desktop applicationsDoes not service Windows components
DISM and neighboring tools

In PowerShell scripts, the module cmdlets such as Mount-WindowsImage, Add-WindowsDriver and Enable-WindowsOptionalFeature are often preferable because they return objects that can be filtered and piped, whereas dism.exe returns text that must be parsed.

Limitations and common DISM mistakes

Most DISM failures come from version mismatches and interrupted sessions rather than from the tool itself. A host can service images of the same or older Windows versions, but servicing a newer image usually requires the DISM version from the matching Windows ADK.

  • Running DISM without elevation produces error 740 instead of a result.
  • A mount left open after a crash must be cleaned with /Cleanup-Mountpoints before the folder can be reused.
  • Using /ResetBase removes the ability to uninstall existing updates, so it suits finished reference images rather than production servers under change control.
  • Antivirus scanning of a mounted folder can slow servicing dramatically or cause commit failures.
  • Repairing with a source of a different build or edition leaves corruption in place.

The simple explanation

Think of a Windows installation as a large, carefully organized warehouse of parts. DISM is the warehouse manager: it can list what is on the shelves, add new parts, remove old ones and replace broken ones with fresh copies.

It can work on the warehouse that is open for business. That is the running computer. It can also work on a blueprint copy used to build many new computers. When Windows updates keep failing, DISM often restores the spare parts. Then the system can fix itself.

How it is used in practice

An IT team at a school district prepares one Windows 11 reference image for 1,200 classroom laptops. A technician mounts index 3 of the WIM file with /Mount-Image, injects the network and storage drivers with /Add-Driver /Recurse, adds the latest cumulative update with /Add-Package, enables .NET Framework 3.5 for a legacy grading application and commits the result.

Two months later, several laptops stop installing monthly updates. The help desk runs DISM /Online /Cleanup-Image /RestoreHealth with the district’s install.wim as the source, followed by sfc /scannow. Both tools report successful repairs, and the pending update installs on the next attempt, avoiding a full reimage of each affected laptop.