Injecting drivers directly into a Windows installation image is one of the most reliable ways to ensure hardware compatibility during OS deployment — whether you are building a golden WIM for SCCM task sequences, preparing Windows PE boot media, or creating a reference image for Autopilot. This updated guide covers both the DISM command-line approach and the modern PowerShell cmdlet equivalents, including support for FFU images and Windows 11 25H2.
| Detail | |
|---|---|
| Last Updated | March 2026 |
| Applies To | Windows 10, Windows 11, Windows Server 2019/2022/2025, Windows PE |
| Image Formats Supported | WIM, FFU, VHD, VHDX |
| Tools Used | DISM, Add-WindowsDriver, Mount-WindowsImage |
| Requires Admin | Yes |
| Difficulty | Intermediate |
When to Inject Drivers vs Using Dynamic Update
Before injecting drivers, consider whether you actually need to. Windows 11 deployments with Dynamic Update enabled automatically download the latest drivers during setup from Windows Update — covering most common hardware without any manual driver injection. Driver injection into the WIM is the right approach when:
- Devices lack internet access during OS deployment (air-gapped or WSUS-only environments)
- Critical storage or network drivers are missing and Windows setup cannot proceed without them
- You need a specific driver version rather than whatever Windows Update provides
- You are building a Windows PE boot image that needs NVMe, USB 3.x, or Wi-Fi support during imaging
- You maintain a golden WIM that must be fully consistent regardless of network conditions at deployment time
Prepare Your Folder Structure
A clean folder structure prevents confusion when working with multiple images and driver sets. Use this layout throughout the guide:
# Create working folder structure
New-Item -ItemType Directory -Path "C:\WimWork\ISO" -Force # Copy WIM/ISO contents here
New-Item -ItemType Directory -Path "C:\WimWork\Mount" -Force # Mount point — must be empty
New-Item -ItemType Directory -Path "C:\WimWork\Drivers" -Force # Driver INF files go here
New-Item -ItemType Directory -Path "C:\WimWork\Output" -Force # Modified WIM output
Extract your driver package (from vendor ZIP or EXE) into subfolders under C:\WimWork\Drivers\. Create a separate subfolder per driver — e.g. Drivers\Intel_NIC\, Drivers\Realtek_Audio\. DISM will recurse through all subfolders automatically when you use the /Recurse switch.
Step 1: Identify the Image Index
A WIM file can contain multiple Windows editions (e.g. Home, Pro, Enterprise). You need to identify the index number of the edition you want to modify.
Via DISM command line
dism /Get-WimInfo /WimFile:"C:\WimWork\ISO\sources\install.wim"
Via PowerShell cmdlet
Get-WindowsImage -ImagePath "C:\WimWork\ISO\sources\install.wim" |
Select-Object ImageIndex, ImageName, ImageDescription |
Format-Table -AutoSize
Note the ImageIndex number of the edition you want to modify. If you need to service multiple editions, you must mount, modify, and unmount each index separately.
Step 2: Handle install.esd — Convert to WIM if Needed
Modern Windows 11 ISOs often ship with install.esd instead of install.wim. DISM cannot mount ESD files directly — you must convert to WIM first:
# Convert install.esd to install.wim (replace index number as needed)
# First, check available indexes in the ESD
dism /Get-WimInfo /WimFile:"C:\WimWork\ISO\sources\install.esd"
# Export the desired edition to a new WIM file
dism /Export-Image `
/SourceImageFile:"C:\WimWork\ISO\sources\install.esd" `
/SourceIndex:6 `
/DestinationImageFile:"C:\WimWork\ISO\sources\install.wim" `
/Compress:max `
/CheckIntegrity
Step 3: Mount the WIM Image
Via DISM command line
# Mount index 1 (adjust index number from Step 1)
dism /Mount-Image `
/ImageFile:"C:\WimWork\ISO\sources\install.wim" `
/Index:1 `
/MountDir:"C:\WimWork\Mount"
Via PowerShell cmdlet (preferred)
Mount-WindowsImage `
-ImagePath "C:\WimWork\ISO\sources\install.wim" `
-Index 1 `
-Path "C:\WimWork\Mount"
Mounting a Windows 11 image can take 3–10 minutes depending on image size and storage speed. The Mount directory should now contain the full Windows file system tree.
Step 4: Add Drivers to the Mounted Image
Add a single driver (DISM)
dism /Image:"C:\WimWork\Mount" /Add-Driver /Driver:"C:\WimWork\Drivers\Intel_NIC\e2f68.inf"
Add all drivers from a folder recursively (DISM)
# /Recurse scans all subfolders — recommended for large driver packs
dism /Image:"C:\WimWork\Mount" /Add-Driver /Driver:"C:\WimWork\Drivers" /Recurse
Add all drivers recursively (PowerShell cmdlet — preferred)
Add-WindowsDriver `
-Path "C:\WimWork\Mount" `
-Driver "C:\WimWork\Drivers" `
-Recurse `
-Verbose
The -Verbose flag prints each driver as it is added — useful for confirming all expected drivers were picked up. If a driver fails to add (e.g. architecture mismatch), it is skipped with a warning rather than stopping the entire operation.
Add unsigned drivers (use with caution)
# ForceUnsigned bypasses digital signature requirement
# Only use for trusted internal drivers — never for public-facing deployments
dism /Image:"C:\WimWork\Mount" /Add-Driver /Driver:"C:\WimWork\Drivers\unsigned.inf" /ForceUnsigned
Step 5: Verify Drivers Were Added
# List all drivers in the mounted image
dism /Image:"C:\WimWork\Mount" /Get-Drivers
# PowerShell equivalent — cleaner output
Get-WindowsDriver -Path "C:\WimWork\Mount" |
Where-Object { $_.ProviderName -notlike "*Microsoft*" } |
Select-Object Driver, OriginalFileName, ProviderName, Version, Date |
Format-Table -AutoSize
Added driver packages are renamed to Oem0.inf, Oem1.inf etc. in the driver store — this is expected behaviour and guarantees unique naming. The original INF filename is preserved in the OriginalFileName property.
Step 6: Unmount and Commit Changes
Via DISM
# Commit changes and unmount
dism /Unmount-Image /MountDir:"C:\WimWork\Mount" /Commit
# Discard changes (if something went wrong)
dism /Unmount-Image /MountDir:"C:\WimWork\Mount" /Discard
Via PowerShell cmdlet
# Commit and unmount
Dismount-WindowsImage -Path "C:\WimWork\Mount" -Save
# Discard and unmount
Dismount-WindowsImage -Path "C:\WimWork\Mount" -Discard
Unmounting and committing a large Windows 11 image can take 10–20 minutes. Do not interrupt this process — a failed commit can corrupt the WIM. Always keep a backup copy of the original WIM before modifying it.
Complete PowerShell Script — End to End
A complete, production-ready script that mounts the image, adds all drivers, verifies the result, and unmounts with error handling:
# Add-DriversToWIM.ps1
# Requires elevation (Run as Administrator)
param (
[string]$WimPath = "C:\WimWork\ISO\sources\install.wim",
[int] $WimIndex = 1,
[string]$MountDir = "C:\WimWork\Mount",
[string]$DriverPath = "C:\WimWork\Drivers"
)
$ErrorActionPreference = "Stop"
try {
# Verify paths
if (-not (Test-Path $WimPath)) { throw "WIM file not found: $WimPath" }
if (-not (Test-Path $DriverPath)) { throw "Driver folder not found: $DriverPath" }
if (-not (Test-Path $MountDir)) { New-Item -ItemType Directory -Path $MountDir -Force | Out-Null }
# Show available indexes
Write-Host "`nAvailable images in WIM:"
Get-WindowsImage -ImagePath $WimPath | Select-Object ImageIndex, ImageName | Format-Table -AutoSize
# Mount the image
Write-Host "Mounting index $WimIndex from $WimPath..."
Mount-WindowsImage -ImagePath $WimPath -Index $WimIndex -Path $MountDir
Write-Host "Image mounted at $MountDir"
# Add drivers
Write-Host "`nAdding drivers from $DriverPath (recursive)..."
$addResult = Add-WindowsDriver -Path $MountDir -Driver $DriverPath -Recurse -Verbose
Write-Host "Drivers added: $($addResult.Count)"
# Verify
Write-Host "`nThird-party drivers now in image:"
Get-WindowsDriver -Path $MountDir |
Where-Object { $_.ProviderName -notlike "*Microsoft*" } |
Select-Object OriginalFileName, ProviderName, Version |
Format-Table -AutoSize
# Commit and unmount
Write-Host "Committing changes and unmounting..."
Dismount-WindowsImage -Path $MountDir -Save
Write-Host "Done. Modified WIM saved to $WimPath"
} catch {
Write-Host "ERROR: $_" -ForegroundColor Red
Write-Host "Attempting to discard changes and unmount..."
try { Dismount-WindowsImage -Path $MountDir -Discard -ErrorAction SilentlyContinue } catch {}
exit 1
}
Adding Drivers to boot.wim (Windows PE)
The boot.wim contains two indexes: index 1 is Windows PE Setup (used during OS installation) and index 2 is Windows PE Maintenance (WinRE). For SCCM task sequences, you typically need to add NVMe, USB 3.x, or network drivers to index 2 so the task sequence engine can access storage and network during deployment.
# Add drivers to boot.wim index 2 (Windows PE / task sequence environment)
Mount-WindowsImage `
-ImagePath "C:\WimWork\ISO\sources\boot.wim" `
-Index 2 `
-Path "C:\WimWork\Mount"
Add-WindowsDriver `
-Path "C:\WimWork\Mount" `
-Driver "C:\WimWork\Drivers\NVMe" `
-Recurse `
-Verbose
Dismount-WindowsImage -Path "C:\WimWork\Mount" -Save
