DISM(Deployment Image Servicing and Management,部署映像服务和管理)是 Windows 官方系统映像离线 / 在线维护命令行工具。 核心定位:上层命令行封装 + COM 服务 + WMI + 底层映像处理库,用来维护 WIM/SWM/ESD/FFU/VHDX 系统镜像,同时支持在线运行中系统(/Online)的组件修复、驱动注入、功能启用。
DISM.exe
一、底层原理
DISM(Deployment Image Servicing and Management,部署映像服务和管理)是 Windows 官方系统映像离线 / 在线维护命令行工具。
核心定位:上层命令行封装 + COM 服务 + WMI + 底层映像处理库,用来维护 WIM/SWM/ESD/FFU/VHDX 系统镜像,同时支持在线运行中系统(/Online)的组件修复、驱动注入、功能启用。
底层模型分为两大模式:
- 离线模式(
/Image):读取挂载的镜像目录,直接修改镜像内文件、组件清单,不加载目标镜像内核,仅操作文件与组件存储库(WinSxS)。 - 在线模式(
/Online):直接调用本机正在运行系统的组件存储库,对当前操作系统进行修复、增减 Windows 功能包。
核心内核逻辑:
- WIM:文件级镜像,基于
wimlib风格微软原生 WIM 库,记录文件元数据 + 数据流,不是按扇区拷贝。- FFU:扇区级整块磁盘镜像,直接读写磁盘扇区,不关心文件系统,用于整盘部署。
- 组件维护:操作WinSxS 组件存储,基于 CBS(Component Based Servicing,基于组件的服务)模型。
二、依赖文件
dism.exe 主可执行程序(%SystemRoot%\System32\Dism.exe)
DismCore.dll DISM核心业务逻辑库(核心)
DismProvider.dll 提供各类镜像服务提供程序
WimProvider.dll WIM/SWM/ESD镜像处理提供程序
FfuProvider.dll FFU磁盘镜像处理提供程序
VhdProvider.dll VHD/VHDX虚拟磁盘支持
CbsProvider.dll CBS组件维护提供程序(在线修复、功能启用)
DismApi.dll DISM对外API,可供PowerShell调用
系统底层依赖:
cbs.dll、cbsapi.dll:CBS 组件服务wimgapi.dll:WIM 映像底层 API(旧版 WIMGAPI,WIM 核心读写库)vhdmp.sys、vdrvroot.sys:VHD 虚拟磁盘内核驱动(挂载 VHD 镜像需要)ntdll.dll、kernel32.dll、advapi32.dll:基础 win32 API- COM 子系统
ole32.dll、oleaut32.dll - wmi 组件
wbemprox.dll(部分操作依赖 WMI)
三、依赖关系
- DISM.exe ← DismCore.dll:主程序只是命令行解析器,所有业务转发到 DismCore.dll。
- DismCore.dll ← 各个 Provider 插件,插件按需加载:
- WIM 操作 → WimProvider.dll → wimgapi.dll
- FFU 操作 → FfuProvider.dll(直接调用底层磁盘读写 API,操作物理磁盘句柄)
- 系统组件修复 / 启用功能 → CbsProvider.dll → cbs.dll(CBS 服务)
- VHD 挂载 → VhdProvider.dll → 虚拟磁盘驱动栈
- 在线模式依赖:TrustedInstaller 服务(TiWorker.exe) 在线修复系统、添加 Windows 功能包时,DISM 提交任务给 CBS,CBS 调用 TrustedInstaller 执行文件替换,TiWorker 负责 WinSxS 文件落地。
- 离线镜像模式:不需要 TiWorker,直接修改挂载目录文件和组件清单。
权限依赖:绝大多数 DISM 操作必须管理员权限;FFU 写入整盘还需要磁盘写权限。
四、配套链(系统配套组件)
- CBS(Component Based Servicing)组件服务:
TrustedInstaller、cbs.log日志,负责系统组件安装、删除、版本校验、文件替换。 - WIM 库栈:wimgapi.dll,负责 WIM 压缩、索引管理、追加 / 导出 / 捕获。
- FFU 底层磁盘 IO 栈:
disk.sys、volsnap.sys,直接访问磁盘设备对象\\.\PhysicalDriveX。 - 虚拟磁盘框架 VDS/VHD:用于 VHDX 镜像挂载。
- Windows 更新组件(wuauserv):
/RestoreHealth在线修复时,DISM 会联系 Windows Update 服务器下载缺失组件包。 - 日志子系统:DISM 日志默认路径:
%windir%\Logs\DISM\dism.log;CBS 日志:%windir%\Logs\CBS\cbs.log。
五、逻辑链路(执行逻辑链)
用户输入 DISM.exe /参数
↓
dism.exe 解析命令行参数,校验参数合法性
↓
加载 DismCore.dll,将参数转发给核心引擎
↓
DismCore 判断操作类型,加载对应 Provider
├─ WIM操作 → WimProvider → wimgapi.dll 读写WIM文件
├─ FFU操作 → FfuProvider → 打开物理磁盘句柄,扇区读写
├─ CBS系统维护 → CbsProvider → 调用CBS API
└─ VHD操作 → VhdProvider → 挂载VHD虚拟磁盘
↓
Provider执行镜像/组件操作,写入日志
↓
执行完成,返回退出码(0成功,非0为错误代码)
分支:在线修复场景 /Online /Cleanup-Image /RestoreHealth
DISM → DismCore → CbsProvider → CBS API
→ CBS 发起请求 → 访问Windows Update服务器下载缺失组件包
→ 交给TrustedInstaller(TiWorker.exe) 替换WinSxS损坏文件
→ 记录CBS日志、DISM日志
六、调用链(上层调用入口)
- CMD/BAT:直接调用
dism.exe(最原始调用) - PowerShell:
- 方式 1:直接调用
dism.exe外部进程 - 方式 2:调用 DISM 托管 API / 映像相关 PowerShell Cmdlet(底层调用 DismApi.dll)
- 方式 1:直接调用
- Windows 安装程序、WinPE 部署脚本:WinPE 内置 DISM,用于系统部署,捕获 / 应用 WIM/FFU
- MDT、Microsoft Deployment Toolkit、Azure Image Builder、OEM 工厂预装工具,后台调用 DISM 做镜像处理
- 第三方工具(部分镜像工具)调用
DismApi.dllCOM 接口,复用微软原生镜像引擎,不自己实现 WIM/FFU 解析
七、边界(能力边界、限制、约束)
✅ 能力边界
- 支持离线镜像维护(WIM/SWM/ESD/FFU/VHDX),离线注入驱动、启用 Windows 功能、清理组件。
- 支持在线系统维护,修复系统损坏组件、删除废弃组件包。
- FFU 支持整磁盘扇级捕获 / 写入;WIM 是文件级捕获,只抓取占用文件,不复制空闲扇区。
❌ 硬限制边界
- DISM 不能修复内核 bootloader 底层固件问题,只维护 Windows 组件存储库,MBR/EFI 引导损坏无法通过 DISM 修复。
- FFU 操作需要管理员 + 磁盘权限,FFU 是整盘操作,一旦
/Apply-Ffu会全盘覆盖,直接清空目标磁盘,没有分区级还原。 - WIM 不能直接写入运行中系统;在线模式只能用 CBS 做组件修复,不能直接捕获正在运行系统的 WIM(需要 WinPE 环境捕获)。
- 离线镜像操作无法执行需要内核加载的动作(不能安装内核级驱动到离线镜像并运行,仅注入驱动文件到驱动库)。
/RestoreHealth在线修复依赖网络访问微软更新服务器;内网隔离环境必须指定本地源/Source。- 部分旧版 Windows(Win7)DISM 版本功能残缺,FFU 仅 Win10 1709+、Win11 原生支持。
- DISM不处理文件系统坏道;磁盘硬件坏块会直接导致 FFU 捕获 / 应用失败。
- 权限边界:普通用户直接执行 DISM 大部分镜像 / CBS 命令直接拒绝;仅少量只读查询命令允许普通用户运行。
其他边界
- 挂载镜像占用临时目录(ScratchDir),磁盘空间不足直接失败;
- 挂载的 WIM 镜像不能被多进程同时修改,独占锁;
- 大镜像操作消耗大量内存,内存不足会导致捕获 / 优化 FFU/WIM 失败。
C:\Users\Administrator>dism /?
Deployment Image Servicing and Management tool
Version: 10.0.26100.5074
DISM.exe [dism_options] {Imaging_command} [<Imaging_arguments>]
DISM.exe {/Image:<path_to_offline_image> | /Online} [dism_options] {servicing_command} [<servicing_arguments>]
DESCRIPTION:
DISM enumerates, installs, uninstalls, configures, and updates features and packages in Windows images. The commands that are available depend on the image being serviced and whether the image is offline or running.
**FFU COMMANDS****FFU 全闪存镜像相关命令**
DISM.exe /Capture-Ffu 捕获物理磁盘,生成 FFU 全磁盘镜像,按扇区完整抓取整块磁盘
DISM.exe /Apply-Ffu 将 FFU 镜像写入目标物理磁盘,全盘还原(覆盖整盘)
DISM.exe /Split-Ffu 将单个大 FFU 镜像分割为多个分卷 FFU 文件,方便存储分发
DISM.exe /Optimize-Ffu 优化 FFU 镜像,清理空闲扇区、压缩冗余数据,减小镜像体积
**WIM COMMANDS****WIM 基于文件镜像相关命令**
DISM.exe /Apply-CustomDataImage 应用自定义数据 WIM 镜像,用于存放额外静态数据
DISM.exe /Capture-CustomImage 捕获自定义数据分区生成自定义数据 WIM 镜像
DISM.exe /Get-WIMBootEntry 查询 WIMBoot 模式的引导条目信息
DISM.exe /Update-WIMBootEntry更新 WIMBoot 引导配置项
DISM.exe /List-Image 列出 WIM 镜像内包含的文件与目录列表
DISM.exe /Delete-Image 删除 WIM 文件内指定索引的镜像版本
DISM.exe /Export-Image 导出 WIM 内指定索引镜像到新 WIM 文件,可压缩转换
DISM.exe /Append-Image 将新捕获的系统映像追加到现有 WIM 文件,新增镜像索引
DISM.exe /Capture-Image 捕获分区 / 目录,生成 WIM 系统镜像(文件级捕获,非整盘)
DISM.exe /Get-MountedWimInfo 查询所有已挂载 WIM 镜像的挂载状态、路径、索引
DISM.exe /Get-WimInfo 读取 WIM 文件元信息:索引、版本、大小、描述等
DISM.exe /Commit-Wim 保存对已挂载 WIM 镜像内的修改,写入 WIM 源文件
DISM.exe /Unmount-Wim 卸载已挂载的 WIM 镜像,可选提交或丢弃修改
DISM.exe /Mount-Wim 将 WIM 镜像挂载到本地目录,离线修改系统文件
DISM.exe /Remount-Wim 恢复挂载失效、异常断开的 WIM 挂载点
DISM.exe /Cleanup-Wim 清理残留的 WIM 挂载临时文件与失效挂载项
**GENERIC IMAGING COMMANDS****通用镜像管理命令(WIM/FFU 通用底层镜像操作)**
DISM.exe /Split-Image 分割镜像文件为多个分卷文件(WIM 为主)
DISM.exe /Apply-Image 应用 WIM 镜像到目标分区(文件级部署系统)
DISM.exe /Get-MountedImageInfo 查询所有已挂载镜像通用信息(统一接口)
DISM.exe /Get-ImageInfo 获取镜像文件通用元数据信息
DISM.exe /Commit-Image 提交已挂载镜像的修改
DISM.exe /Unmount-Image 卸载通用镜像挂载点
DISM.exe /Mount-Image 挂载镜像到本地目录离线编辑
DISM.exe /Remount-Image 修复异常断开的镜像挂载
DISM.exe /Cleanup-Mountpoints 批量清理所有残留无效挂载点目录与临时文件
**IMAGE SPECIFICATIONS****镜像源参数(作为其他命令的参数)**
DISM.exe /Online 操作当前正在运行的在线操作系统,而非离线 wim/ffu 镜像
DISM.exe /Image 指定离线镜像挂载目录路径,用于离线维护镜像
**DISM OPTIONS****DISM 全局通用选项**
DISM.exe /English 强制 DISM 输出英文提示文本,不受系统区域语言影响
DISM.exe /Format 指定导出镜像的输出格式(WIM/SWM 等)
DISM.exe /WinDir 指定 Windows 系统目录路径,离线镜像维护时使用
DISM.exe /SysDriveDir 指定系统引导分区目录
DISM.exe /LogPath 自定义日志文件保存路径,记录 DISM 完整执行日志
DISM.exe /LogLevel 设置日志详细等级,控制日志记录信息量
DISM.exe /NoRestart 操作完成后不自动重启计算机
DISM.exe /Quiet 静默模式,无交互、不输出控制台信息
DISM.exe /ScratchDir 指定 DISM 临时缓存目录,用于存放解压临时文件
For more information about these DISM options and their arguments, specify an option immediately before /?.
Examples:
DISM.exe /Mount-Wim /?
DISM.exe /ScratchDir /?
DISM.exe /Image:C:\test\offline /?
DISM.exe /Online /?

C:\Users\Administrator>dism /?
Deployment Image Servicing and Management tool
Version: 10.0.26100.5074
DISM.exe [dism_options] {Imaging_command} [<Imaging_arguments>]
DISM.exe {/Image:<path_to_offline_image> | /Online} [dism_options]{servicing_command} [<servicing_arguments>]
DESCRIPTION:
DISM enumerates, installs, uninstalls, configures, and updates features and packages in Windows images. The commands that are available depend on the image being serviced and whether the image is offline or running.
FFU COMMANDS:
/Capture-Ffu - Captures a physical disk image into a new FFU file.
/Apply-Ffu - Applies an .ffu image.
/Split-Ffu - Splits an existing .ffu file into multiple read-only split FFU files.
/Optimize-Ffu - Optimizes a FFU file so that it can be applied to storage of a different size.
WIM COMMANDS:
/Apply-CustomDataImage - Dehydrates files contained in the custom data image.
/Capture-CustomImage - Captures customizations into a delta WIM file on a WIMBoot system. Captured directories include all subfolders and data.
/Get-WIMBootEntry - Displays WIMBoot configuration entries for the specified disk volume.
/Update-WIMBootEntry - Updates WIMBoot configuration entry for the specified disk volume.
/List-Image - Displays a list of the files and folders in a specified image.
/Delete-Image - Deletes the specified volume image from a WIM file that has multiple volume images.
/Export-Image - Exports a copy of the specified image to another file.
/Append-Image - Adds another image to a WIM file.
/Capture-Image - Captures an image of a drive into a new WIM file. Captured directories include all subfolders and data.
/Get-MountedWimInfo - Displays information about mounted WIM images.
/Get-WimInfo - Displays information about images in a WIM file.
/Commit-Wim - Saves changes to a mounted WIM image.
/Unmount-Wim - Unmounts a mounted WIM image.
/Mount-Wim - Mounts an image from a WIM file.
/Remount-Wim - Recovers an orphaned WIM mount directory.
/Cleanup-Wim - Deletes resources associated with mounted WIM images that are corrupted.
GENERIC IMAGING COMMANDS:
/Split-Image - Splits an existing .wim file into multiple read-only split WIM (SWM) files.
/Apply-Image - Applies an image.
/Get-MountedImageInfo - Displays information about mounted WIM and VHD images.
/Get-ImageInfo - Displays information about images in a WIM, a VHD or a FFU file.
/Commit-Image - Saves changes to a mounted WIM or VHD image.
/Unmount-Image - Unmounts a mounted WIM or VHD image.
/Mount-Image - Mounts an image from a WIM or VHD file.
/Remount-Image - Recovers an orphaned image mount directory.
/Cleanup-Mountpoints - Deletes resources associated with corrupted mounted images.
IMAGE SPECIFICATIONS:
/Online - Targets the running operating system.
/Image - Specifies the path to the root directory of an offline Windows image.
DISM OPTIONS:
/English - Displays command line output in English.
/Format - Specifies the report output format.
/WinDir - Specifies the path to the Windows directory.
/SysDriveDir - Specifies the path to the system-loader file named BootMgr.
/LogPath - Specifies the logfile path.
/LogLevel - Specifies the output level shown in the log (1-4).
/NoRestart - Suppresses automatic reboots and reboot prompts.
/Quiet - Suppresses all output except for error messages.
/ScratchDir - Specifies the path to a scratch directory.
For more information about these DISM options and their arguments, specify an
option immediately before /?.
Examples:
DISM.exe /Mount-Wim /?
DISM.exe /ScratchDir /?
DISM.exe /Image:C:\test\offline /?
DISM.exe /Online /?
C:\Users\Administrator>
C:\Users\Administrator>dism.exe /online /?
Deployment Image Servicing and Management tool
Version: 10.0.26100.5074
Image Version: 10.0.26100.33438
The following commands may be used to service the image:
OS UNINSTALL SERVICING COMMANDS:
/Set-OSUninstallWindow - Sets the OS Uninstall Window.
/Get-OSUninstallWindow - Gets the OS Uninstall Window.
/Remove-OSUninstall - Remove the OS Uninstall.
/Initiate-OSUninstall - Initiates the OS Uninstall
APPX 服务命令:
/Get-NonRemovableAppPolicy - 列出配置为不能通过企业策略删除的程序包系列。
/Set-NonRemovableAppPolicy - 为指定的程序包系列设置 企业的不可删除策略。
/Optimize-ProvisionedAppxPackages - 通过跨 appx 数据包硬链接相同文件优化预配的 appx 占用空间。
/Set-ProvisionedAppxDataFile - 将自定义数据放入指定的应用包 (.appx 或 .appxbundle)。指定的应用程序包必须已在映像中。
/Remove-ProvisionedAppxPackage - 从映像中删除应用包(.appx 或 .appxbundle)。 创建新的用户账户时,将 不安装这些应用包。
/Add-ProvisionedAppxPackage - 将应用包(.appx 或 .appxbundle)添加到映像 并将其设置为对每个新用户进行安装。
/Get-ProvisionedAppxPackages - 显示有关映像中设置为对每个新用户进行 安装的应用包 (.appx 或 .appxbundle)的信息。
程序包服务命令:
/Add-Package - 向映像中添加程序包。
/Remove-Package - 从映像中删除程序包。
/Enable-Feature - 启用映像中的特定功能。
/Disable-Feature - 禁用映像中的特定功能。
/Get-Packages - 显示有关映像中所有程序包的信息。
/Get-PackageInfo - 显示有关特定程序包的信息。
/Get-Features - 显示有关程序包中所有功能的信息。
/Get-FeatureInfo - 显示有关特定功能的信息。
/Cleanup-Image - 对映像执行清理和恢复操作。
/Export-Source - 将一组功能导出到新存储库中。
/Add-Capability - 将一个或多个功能添加到图像中。
/Remove-Capability - 从一个映像中删除功能。
/Get-Capabilities - 获取映像中的功能。
/Get-CapabilityInfo - 获取映像中功能的信息。
/Get-ReservedStorageState - 获取保留存储空间的当前状态。
/Set-ReservedStorageState - 设置保留存储空间的当前状态。
/Add-Language - 为给定语言添加最匹配包。
/Remove-Language - 删除给定语言的最佳匹配包。
操作系统常规命令:
/Optimize-Image - 对脱机映像执行指定的配置。
驱动程序服务命令:
/Remove-Driver - 从脱机映像中删除驱动程序包。
/Add-Driver - 向脱机映像中添加驱动程序包。
/Get-DriverInfo - 显示有关脱机映像中或正在运行的操作系统中的 特定驱动程序的信息。
/Get-Drivers - 显示有关脱机映像中或正在运行的操作系统中的所有驱动程序的信息。
/Export-Driver - 从脱机映像或正在运行的操作系统导出所有第三方驱动程序包。
应用程序服务命令:
/Check-AppPatch - 显示有关 MSP 修补程序是否适用于安装的映像的信息。
/Get-AppPatchInfo - 显示有关安装的 MSP 修补程序的信息。
/Get-AppPatches - 显示有关应用于所有安装的应用程序的所有MSP 修补程序的信息。
/Get-AppInfo - 显示有关特定安装的 MSI 应用程序的信息。
/Get-Apps - 显示有关安装的所有 MSI 应用程序的信息。
默认关联命令:
/Remove-DefaultAppAssociations - 删除 Windows 映像中的默认应用程序关联。
/Import-DefaultAppAssociations - 向 Windows 映像导入一组默认应用程序关联。
/Get-DefaultAppAssociations - 显示 Windows 映像中默认应用程序关联的列表。
/Export-DefaultAppAssociations - 从运行的操作系统导出 默认的应用程序关联。
国际服务命令:
/Set-SysUILang - 设置安装的脱机映像中使用的 系统 UI 语言。
/Set-LayeredDriver - 设置键盘分层驱动程序。
/Set-UILang - 设置安装的脱机映像中使用的默认系统用户界面语言。
/Set-UILangFallback - 设置安装的脱机映像中系统用户界面的回退默认语言。
/Set-UserLocale - 设置安装的脱机映像中的用户区域设置。
/Set-SysLocale - 设置安装的脱机映像中的非 Unicode 程序的语言(也称为系统区域设置)和字体设置。
/Set-InputLocale - 设置要在安装的脱机映像中使用的输入区域设置和键盘布局。
/Set-TimeZone - 设置安装的脱机映像中的默认时区。
/Set-AllIntl - 设置安装的脱机映像中的所有国际设置。
/Set-SKUIntlDefaults - 将安装的脱机映像中的指定 SKU 语言的所有国际设置都设置为默认值。
/Gen-LangIni - 生成新的 lang.ini 文件。
/Set-SetupUILang - 定义安装程序将使用的默认语言。
/Get-Intl - 显示有关国际设置和语言的信息。
无人参与服务命令:
/Apply-Unattend - 将无人参与文件应用于映像。
EDGE 服务命令:
/Add-Edge - 将 Microsoft Edge 添加到映像。
/Add-EdgeBrowser - 将 Microsoft Edge 浏览器添加到映像。
/Add-EdgeWebView - 将 Microsoft Edge WebView 添加到映像。
预配程序包服务命令:
/Get-ProvisioningPackageInfo - 获取预配程序包的信息。
/Add-ProvisioningPackage - 添加预配程序包。
WINDOWS 版本服务命令:
/Set-ProductKey - 设置脱机映像的产品密钥。
/Get-TargetEditions - 显示可以将映像升级到的Windows 版本列表。
/Get-CurrentEdition - 显示当前映像的版本。
/Set-Edition - 将映像升级到较高的版本。
For more information about these servicing commands and their arguments,specify a command immediately before /?.
Examples:
DISM.exe /Image:C:\test\offline /Apply-Unattend /?
DISM.exe /Image:C:\test\offline /Get-Features /?
DISM.exe /Online /Get-Drivers /?
dism /Get-WimInfo /?
Deployment Image Servicing and Management tool
Version: 10.0.20348.681
/Get-WimInfo /WimFile:<WIM_file> [/Index:<image_index> | /Name:<image_name>]
Displays information about the images contained in the specified WIM file.
Examples:
DISM.exe /Get-WimInfo /WimFile:C:\test\images\myimage.wim
DISM.exe /Get-WimInfo /WimFile:C:\test\images\myimage.wim /Index:1
dism /image /?
Deployment Image Servicing and Management tool
Version: 10.0.20348.681
/Image:<path_to_offline_image>
This is the path to the root directory of the offline Windows image.
This option must be used with a servicing command.
Example:
DISM.exe /Image:C:\test\offline /Get-Packages
dism /capture-image /?
Deployment Image Servicing and Management tool
Version: 10.0.20348.681
/Capture-Image /ImageFile:<path_to_image_file> /CaptureDir:<source_directory>
/Name:<Name>
[/Description:Description] [/ConfigFile:<wimscript.ini>]
{[/Compress:{fast|max|none}] [/Bootable] | [/WIMBoot]} [/CheckIntegrity]
[/Verify] [/NoRpFix] [/EA]
Captures an image of a drive to a new WIM file. Captured directories include
all subfolders and data. You cannot capture an empty directory.
Use /ConfigFile to specify the location of a configuration file that lists
exclusions for image capture and compress commands.
Use /Compress to specify the type of compression used for the initial capture
operation.
Use /Bootable to mark a Windows PE volume image as able to be booted.
Use /WIMBoot to capture the image that can be applied with WIMBoot
configuration.
Use /CheckIntegrity to detect and track WIM file corruption.
Use /Verify to check for errors and file duplication.
Use /NoRpFix to disable the reparse point tag fix.
Use /EA to capture extended attributes.
Example:
DISM.exe /Capture-Image /ImageFile:install.wim /CaptureDir:D:\
/Name:Drive-D
dism /Capture-Ffu /?
Deployment Image Servicing and Management tool
Version: 10.0.20348.681
/Capture-Ffu /ImageFile:<path_to_image_file> /CaptureDrive:<physical_drive_path>
/Name:<Name>
[/Description:Description] [/PlatformIds:<platform_ids>]
[/Compress:{default|none}]
Captures a physical disk image to a new FFU file.
Use /PlatformIds to specify one or more platform ids (separate with semicolon) to be added to the image. If not specified, platform id will be '*'. Use /Compress to specify the type of compression used for the initial capture operation.
Example:
DISM.exe /Capture-Ffu /ImageFile:install.ffu
/CaptureDrive:\\.\PhysicalDrive0 /Name:Drive0
/PlatformIds:Microsoft.MSM8994.P6211
/Compress:default
.wim、.vhd、.ffu 文件)以及当前正在运行的操作系统。部署映像服务和管理工具
基本语法
DISM.exe [dism_options] {Imaging_command} [<Imaging_arguments>]
DISM.exe {/Image:<path_to_offline_image> | /Online} [dism_options] {servicing_command} [<servicing_arguments>]
描述
FFU 命令 (Full Flash Update)
/Capture-Ffu- 将物理磁盘的映像捕获到新的 FFU 文件中。/Apply-Ffu- 将 .ffu 映像应用到目标物理磁盘。/Split-Ffu- 将现有的 .ffu 文件拆分为多个只读的拆分 FFU 文件。/Optimize-Ffu- 优化 FFU 文件,使其能够应用于不同大小的存储设备。
WIM 命令 (Windows Imaging Format)
.wim 映像文件的管理与操作:/Apply-CustomDataImage- 冻结(脱水)自定义数据映像中包含的文件。/Capture-CustomImage- 在 WIMBoot 系统上,将自定义设置捕获为增量 WIM 文件。捕获的目录包括所有子文件夹和数据。/Get-WIMBootEntry- 显示指定磁盘卷的 WIMBoot 配置项。/Update-WIMBootEntry- 更新指定磁盘卷的 WIMBoot 配置项。/List-Image- 显示指定映像内的文件和文件夹列表。/Delete-Image- 从包含多个卷映像的 WIM 文件中删除指定的卷映像。/Export-Image- 将指定映像的副本导出到另一个文件中。/Append-Image- 将新的映像追加到现有的 WIM 文件中。/Capture-Image- 将驱动器的映像捕获到新的 WIM 文件中。捕获的目录包括所有子文件夹和数据。/Get-MountedWimInfo- 显示有关已装载(挂载)的 WIM 映像的信息。/Get-WimInfo- 显示 WIM 文件中包含的映像详细信息。/Commit-Wim- 保存对已装载的 WIM 映像所做的更改。/Unmount-Wim- 卸载已装载的 WIM 映像。/Mount-Wim- 将 WIM 文件中的映像装载到指定目录以便编辑。/Remount-Wim- 恢复孤立(异常断开)的 WIM 装载目录。/Cleanup-Wim- 删除与损坏的已装载 WIM 映像关联的资源。
通用映像处理命令
.wim、.vhd 或 .ffu 等多种格式的通用操作:/Split-Image- 将现有的 .wim 文件拆分为多个只读的拆分 WIM (SWM) 文件。/Apply-Image- 将映像应用到指定的分区或目录。/Get-MountedImageInfo- 显示有关已装载的 WIM 和 VHD 映像的信息。/Get-ImageInfo- 显示 WIM、VHD 或 FFU 文件中映像的信息。/Commit-Image- 保存对已装载的 WIM 或 VHD 映像所做的更改。/Unmount-Image- 卸载已装载的 WIM 或 VHD 映像。/Mount-Image- 将 WIM 或 VHD 文件中的映像装载到指定目录。/Remount-Image- 恢复孤立的映像装载目录。/Cleanup-Mountpoints- 删除与损坏的已装载映像关联的资源。
映像目标指定
/Online- 指定对当前正在运行的操作系统执行操作。/Image:<path>- 指定脱机 Windows 映像根目录的完整路径(不能与/Online同时使用)。
DISM 全局选项
/English- 强制以英文显示命令行输出。/Format- 指定报表的输出格式(如表格 Table 或列表 List)。/WinDir- 指定 Windows 目录的路径。/SysDriveDir- 指定系统引导文件 BootMgr 的路径。/LogPath- 指定日志文件的完整路径(默认为%WINDIR%\Logs\Dism\dism.log)。/LogLevel- 指定日志输出级别(1=仅错误,2=错误和警告,3=错误、警告和信息,4=包含调试输出)。/NoRestart- 阻止操作完成后自动重启或提示重启。/Quiet- 静默运行,关闭控制台信息和进度输出,仅显示错误消息。/ScratchDir- 指定解压缩临时文件使用的本地暂存目录。
💡 实用扩展:日常高频使用的 DISM 命令
- 快速检查:
DISM /Online /Cleanup-Image /CheckHealth(仅检查是否有损坏标记,不修复) - 深度扫描:
DISM /Online /Cleanup-Image /ScanHealth(扫描组件存储是否损坏,不修复) - 自动修复:
DISM /Online /Cleanup-Image /RestoreHealth(扫描并修复损坏,默认从 Windows Update 获取源文件)
- 查看当前版本:
DISM /Online /Get-CurrentEdition - 查看可升级的目标版本:
DISM /Online /Get-TargetEditions
如果您想深入了解某个具体命令的参数,可以在该命令后加上
/?。例如:DISM.exe /Mount-Wim /?DISM.exe /Online /?

浙公网安备 33010602011771号