当前位置:网站首页>Dism command usage summary
Dism command usage summary
2022-06-11 05:40:00 【zhmhbest】
DISM Command use summary
List of articles
operation WIM Mirror image
explain
REM Make a mirror and add a volume
dism /capture-image /imagefile:<WIM Image path > /captureDir:< Backup directory > /name:< Sub volume name > [/description:< Sub volume description >]
REM Add a subvolume to the image
dism /append-image /imagefile:<WIM Image path > /captureDir:< Backup directory > /name:< Sub volume name > [/description:< Sub volume description >]
REM Delete a subvolume in the mirror ( It is possible to modify the indexes of all subvolumes )
dism /delete-image /imagefile:<WIM Image path > /Index:< Volume index >
REM Export a subvolume from the image to become a new image
dism /export-image /sourceimageFile:< Source WIM Image path > /sourceindex:< Volume index > /destinationimagefile:< new WIM Image path >
REM View the mirror volume information
dism /get-imageinfo /imagefile:<WIM Image path >
REM View the file contents of a mirrored volume
dism /list-image /imagefile:<WIM Image path > /index:< Volume index >
REM Mount the image
dism /mount-wim /wimfile:<WIM Image path > /index:< Volume index > /mountdir:< Mount Directory > [/readonly]
REM Unmount the image and discard the changes
dism /unmount-wim /mountdir:< Mount Directory > /discard
REM Unload the image and save the changes
dism /unmount-wim /mountdir:< Mount Directory > /commit
REM Use the image to restore the directory
dism /apply-image /imagefile:<WIM Image path > /index:< Volume index > /applydir:< Restore directory >
demonstration
REM Run as administrator CMD
MKDIR "%Temp%\DismDemo" 2>NUL
PUSHD "%Temp%\DismDemo"
MKDIR package
MKDIR mounted
REM Create... For the first time
ECHO first>package\test.txt
dism /capture-image /imagefile:test.wim /captureDir:package /name:1st /description: for the first time >NUL
REM Add image
ECHO second>package\test.txt
dism /append-image /imagefile:test.wim /captureDir:package /name:2nd /description: The second time >NUL
ECHO third>package\test.txt
dism /append-image /imagefile:test.wim /captureDir:package /name:3rd /description: third time >NUL
REM View the volume file
dism /list-image /imagefile:test.wim /index:1
REM View mirrored volumes
dism /get-imageinfo /imagefile:test.wim
REM Mount the image and view the recorded contents
dism /mount-wim /wimfile:test.wim /index:1 /mountdir:mounted /readonly>NUL
type mounted\test.txt
dism /unmount-wim /mountdir:mounted /discard>NUL
REM Use the image to restore the directory
type package\test.txt
dism /apply-image /imagefile:test.wim /index:2 /applydir:package>NUL
type package\test.txt
REM Mount the image and modify the contents of the record
dism /mount-wim /wimfile:test.wim /index:2 /mountdir:mounted>NUL
ECHO second changed>mounted\test.txt
dism /unmount-wim /mountdir:mounted /commit>NUL
dism /mount-wim /wimfile:test.wim /index:2 /mountdir:mounted /readonly>NUL
type mounted\test.txt
dism /unmount-wim /mountdir:mounted /discard>NUL
REM Delete a subvolume
dism /delete-image /imagefile:test.wim /Index:1>NUL
dism /get-imageinfo /imagefile:test.wim
REM Export a subvolume
dism /export-image /sourceimageFile:test.wim /sourceindex:1 /destinationimagefile:new.wim>NUL
dism /get-imageinfo /imagefile:new.wim
POPD
RMDIR /S /Q "%Temp%\DismDemo"
Mount a file with the same name .wim
@ECHO OFF
MKDIR %SystemRoot%\testauth 2>nul && RMDIR %SystemRoot%\testauth || echo "Please run as administrator!" && PAUSE && GOTO :EOF
ECHO mounting...
CD /d %~dp0
SET MYNAME=%~n0
IF NOT EXIST %MYNAME%.wim GOTO :EOF
IF EXIST %MYNAME% (
DISM /unmount-wim /mountdir:"%MYNAME%" /discard
RMDIR %MYNAME%
) ELSE (
MKDIR %MYNAME%
DISM /mount-wim /wimfile:"%MYNAME%.wim" /mountdir:"%MYNAME%" /index:1 /readonly
)
Operating system image
explain
REM Target a running operating system | Specify the root directory path of the offline image
dism { /online | /image:< The address to which the image is mounted > } ...
REM Scan for component storage corruption in the image
dism /online /cleanup-image { /checkhealth | /scanhealth | /restorehealth }
REM Get the current system driver list
dism /online /get-drivers
REM Get the list of current system functions
dism /online /get-features /format:table
REM Enable current system functions
dism /online enable-feature /featurename:< The name of the function > /all
Add functionality
DIR /b %SystemRoot%\servicing\Packages
Enable local policy
If it cannot be started gpedit.msc, Then run a command window as an administrator , Enter the following :
@ECHO OFF
SET PACKAGES_LOCATION=%SystemRoot%\servicing\Packages
SET ENABLE_LIST="%Temp%\PACKAGES%RANDOM%%RANDOM%.txt"
REM ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DIR /b %PACKAGES_LOCATION%\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum>%ENABLE_LIST%
DIR /b %PACKAGES_LOCATION%\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum>>%ENABLE_LIST%
REM ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FOR /F %i in ('FINDSTR /I . %ENABLE_LIST% 2^>NUL') DO (
echo %i
dism /online /norestart /add-package:"%PACKAGES_LOCATION%\%i">NUL
)
DEL /F /Q %ENABLE_LIST%
ECHO Done!
Enable Hyper-V
dism /online /get-features /format:table | findstr /i Hyper-V
@ECHO OFF
SET PACKAGES_LOCATION=%SystemRoot%\servicing\Packages
SET ENABLE_LIST="%Temp%\PACKAGES%RANDOM%%RANDOM%.txt"
REM ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
DIR /b %PACKAGES_LOCATION%\Microsoft-Hyper-V-*.mum>%ENABLE_LIST%
REM ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
FOR /F %i in ('FINDSTR /I . %ENABLE_LIST% 2^>NUL') DO (
echo %i
dism /online /norestart /add-package:"%PACKAGES_LOCATION%\%i">NUL
)
DEL /F /Q %ENABLE_LIST%
dism /online /norestart /enable-feature /featurename:Microsoft-Hyper-V-All /all
ECHO Done!
边栏推荐
- Section III: structural characteristics of cement concrete pavement
- 【深入kotlin】 - 初识 Flow
- Manually splicing dynamic JSON strings
- Adapter the problem of executing only one animation in multiple frames
- QT Road (2) -- HelloWorld
- When the recyclerview plays more videos, the problem of refreshing the current video is solved.
- BERT知识蒸馏
- Get the full link address of the current project request URL
- If the MAC fails to connect with MySQL, it will start and report an error
- Stone game -- leetcode practice
猜你喜欢

Multithreading tutorial (XXI) double checked locking problem

NDK learning notes (IX) POSIX sockect connection oriented communication

WinForm (I) introduction to WinForm and use of basic controls

袋鼠云数栈基于CBO在Spark SQL优化上的探索

Getbackgroundaudiomanager controls music playback (dynamic binding of class name)

Customize the layout of view Foundation

getBackgroundAudioManager控制音乐播放(类名的动态绑定)

22、生成括号

Write a list with kotlin

Number of atoms (easy to understand)
随机推荐
Multi threading tutorial (XXIV) cas+volatile
推荐一款免费的内网穿透开源软件,可以在测试本地开发微信公众号使用
袋鼠雲數棧基於CBO在Spark SQL優化上的探索
Section II: structural composition characteristics of asphalt pavement (1) structural composition
MySQL string to array, merge result set, and convert to array
配置Rust编译环境
PCB走线到底能承载多大电流
【深入kotlin】 - Flow 进阶
[project - what are the supporting materials in the annexes? (18 kinds of 2000 word summary)] project plan of innovation and entrepreneurship competition and supporting materials of Challenge Cup entr
49. 字母异位词分组
Basics of customized view
Bit operation marks multiple switches with one parameter
C (I) C basic grammar all in one
深度学习分布式训练
NDK learning notes (II)
Games101 job 7-path tracing implementation process & detailed interpretation of code
[go deep into kotlin] - get to know flow for the first time
Multithreading tutorial (XXIII) thread safety without lock
QT Road (2) -- HelloWorld
How to deal with message blackout and message sending failure of Aurora im