Windows Imaging with DISM — WIM, FFU, and Image Servicing

WINDOWS-DISM

How DISM manages Windows images — capturing and applying WIM and FFU format images, servicing images offline to inject drivers, updates, and features, and using Sysprep to generalise a reference installation before deployment to multiple machines.

windowsdismwimffusysprep

Overview

Every Windows deployment rests on an image — a snapshot of a configured operating system that can be copied to new hardware reproducibly. The Deployment Image Servicing and Management tool (DISM) is the engine underneath every imaging workflow, whether a technician is manually applying a WIM from a USB drive or an MDT task sequence is deploying to hundreds of machines overnight. Understanding DISM means understanding how images are structured, how they are modified without booting into them, and how Sysprep prepares an installation for multi-machine deployment.


Image Formats: WIM and FFU

Windows uses two image formats, each suited to a different deployment scenario.

FeatureWIM (Windows Imaging Format)FFU (Full Flash Update)
Storage unitFile-based — captures individual files and foldersSector-based — copies raw disk sectors
CompressionHigh compression; single-instance storage for duplicate filesLess compressible; sector-level copy
Partial applyYes — apply specific images within the WIMNo — full disk copy required
Apply speedSlower (file extraction overhead)Faster, especially to fixed storage
Capture scopeSingle partition or folderEntire disk including partition table
Hardware independenceYes — applies to any hardwareHardware-specific sector layout
Primary useEnterprise deployment, MDT, SCCM OSDIoT devices, Surface factory provisioning, OEM

WIM is the standard format for the vast majority of enterprise deployments. The install.wim file on Windows installation media uses single-instance storage: if the same DLL appears in both the Windows folder and an application directory, it is stored once in the WIM with multiple references pointing to it. A single WIM file can contain multiple images at different indices — the retail Windows media ships Home, Pro, and Enterprise as separate indices inside one install.wim.

FFU is the right choice when speed matters more than flexibility and the target hardware is known in advance. Surface devices and IoT products are provisioned this way at the factory.


DISM Command Reference

DISM runs in both the full Windows environment and Windows PE, making it available at every stage of a deployment workflow.

CommandPurpose
dism /Get-ImageInfo /ImageFile:install.wimList all images (indices) in a WIM file with names and sizes
dism /Mount-Image /ImageFile:install.wim /Index:1 /MountDir:C:\MountMount a WIM image to a folder for offline servicing
dism /Image:C:\Mount /Add-Driver /Driver:C:\Drivers /RecurseInject all drivers from a folder tree into the mounted image
dism /Image:C:\Mount /Add-Package /PackagePath:C:\Updates\KB.msuAdd a Windows update or cabinet package to the mounted image
dism /Image:C:\Mount /Enable-Feature /FeatureName:NetFx3 /All /Source:D:\sxsEnable an optional Windows feature with source files
dism /Image:C:\Mount /Get-DriversList all third-party drivers in the mounted image
dism /Image:C:\Mount /ScanHealthCheck whether the mounted image has any detectable corruption
dism /Unmount-Image /MountDir:C:\Mount /CommitSave all changes and unmount the image
dism /Unmount-Image /MountDir:C:\Mount /DiscardAbandon all changes and unmount
dism /Capture-Image /ImageFile:D:\custom.wim /CaptureDir:C:\ /Name:"Custom W11"Capture a volume or folder into a new WIM file
dism /Apply-Image /ImageFile:D:\custom.wim /Index:1 /ApplyDir:D:\Apply a WIM image to a partition
dism /Export-Image /SourceImageFile:custom.wim /SourceIndex:1 /DestImageFile:clean.wim /Compress:maxExport an image to a new WIM, reclaiming space after edits
dism /Online /Cleanup-Image /RestoreHealthRepair the running system’s component store using Windows Update

After mounting a WIM and making changes, always export to a new file before deploying. DISM tracks deleted and replaced files in the WIM’s metadata but retains the old blocks on disk. The WIM grows over time with successive edit cycles. Exporting produces a clean WIM containing only the current state.


Sysprep — Generalising a Reference Installation

A freshly installed Windows machine is not ready to be cloned. It carries machine-specific identity: a unique Security Identifier (SID) for the local accounts and the machine itself, the computer name entered during setup, hardware-specific driver entries for the current chipset, and an activation state tied to a particular licence.

Deploying that image to a second machine would produce two machines with identical SIDs — a condition that breaks Kerberos authentication, group membership evaluation, and domain join operations. Sysprep resolves this by stripping all machine-specific state before capture.

C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown

What /generalize does:

The /oobe switch sets the machine to show the Out-of-Box Experience on next boot rather than going directly to the desktop. In an enterprise deployment, the OOBE is typically suppressed by an answer file. The /shutdown switch powers off the machine after generalisation, leaving it in a state ready for WIM capture with DISM.

Sysprep Limitations

Sysprep can be run on a Windows installation a maximum of three times (the rearm limit). Each /generalize operation consumes one rearm count. The remaining count can be checked with slmgr /dlv. If the limit is exhausted, the only remediation is to rebuild the reference machine from scratch. For this reason, reference images should be built from a clean installation with minimal changes — not evolved through repeated cycles of modification and resysprep.

Some applications do not survive Sysprep. Software that stores hardware fingerprints or activation state in the registry or in files will break when the hardware identity changes on the destination machine. Such applications must be installed post-deployment by the task sequence, not baked into the reference image.


Answer Files and Configuration Passes

An answer file (unattend.xml) automates the choices a technician would otherwise make at every setup prompt. The Windows System Image Manager (SIM) tool, included in the ADK, creates answer files by importing a catalog built from the WIM being deployed.

Setup processes the answer file in ordered configuration passes:

PassWhen It RunsTypical Settings
windowsPEWindows PE / setup environmentDisk partitioning, image selection, locale for setup UI
offlineServicingDISM applies packages before first bootAdd packages/drivers offline
generalizeDuring sysprep /generalizeSettings to apply during generalisation
specializeFirst boot, machine-specific phaseComputer name, domain join, network configuration
auditSystemAudit mode, system contextDriver and app pre-installation
auditUserAudit mode, user contextUser-context customisation
oobeSystemOut-of-Box ExperienceSkip OOBE prompts, auto-logon, locale for end user

The answer file is placed at C:\Windows\Panther\unattend.xml or passed directly to setup.exe with /unattend:. For domain-joined deployments, the Microsoft-Windows-UnattendedJoin component in the specialize pass handles the domain join automatically — no human interaction required.


USMT — Capturing and Restoring User Data

The User State Migration Tool bridges wipe-and-load deployments. ScanState captures the source machine; LoadState restores to the destination.

# Capture — run on source machine
scanstate \\server\migration\store /i:MigDocs.xml /i:MigApp.xml /i:MigUser.xml /l:scan.log

# Restore — run on destination after OS deploy
loadstate \\server\migration\store /i:MigDocs.xml /i:MigApp.xml /i:MigUser.xml /l:load.log
Migration XMLContent
MigUser.xmlUser profile folders (Desktop, Documents, AppData)
MigDocs.xmlDocuments, Downloads, Pictures, Music, Videos
MigApp.xmlApplication settings (Office, browser favourites, etc.)

USMT captures settings and data, not applications themselves. Applications must be reinstalled on the destination machine — the task sequence typically handles this.

Migration store types determine where and how the captured data is stored:

Store TypeDescriptionUse Case
Compressed (network share)Single compressed file on a UNC shareMigrating to new hardware
Uncompressed (network share)Files copied directly to UNC shareEasier to browse for troubleshooting
Hard-linkData stays on the same physical disk, linked in placePC refresh on the same machine — fastest, no network required

Hard-link stores cannot be used when migrating to different hardware. They are only valid when the ScanState and LoadState both run on the same machine — a refresh scenario where the disk is wiped and the OS is reinstalled, but the same hardware is retained.


Provisioning Packages

Windows Configuration Designer (WCD) produces provisioning packages (.ppkg files) that configure a device without any imaging infrastructure. A provisioning package can join a domain or Entra ID, apply Wi-Fi profiles, install certificates, and configure settings — all by double-clicking the .ppkg during OOBE or after Windows is running. Provisioning packages are the right tool for small deployments or device handoff scenarios where a full imaging pipeline is not justified.