@Echo Off
COLOR 2F
cd /d "%~dp0"
REM PECMD.EXE LOAD ImDisk.INI
GOTO 123
:Start1
CLS
Echo.
Echo.
Echo 输入的分区盘符不对或不存在, 虚拟盘也不能挂载,请重新输入....
Echo.
:123
Echo.
Set RP=
Set /P RP= 请输入要挂载WIM文件的目标盘符(不含:),比如输入 D 然后回车:
If "%RP%"=="" Goto Start1
If "%RP%"=="A" Goto Start1
If "%RP%"=="a" Goto Start1
If "%RP%"=="B" Goto Start1
If "%RP%"=="b" Goto Start1
If "%RP%"=="X" Goto Start1
If "%RP%"=="x" Goto Start1
For %%I In (Z z Y y W w V v U u T t S s R r Q q P p O o N n M m L l K k J j I i H h G g F f E e D d C c) Do If "%RP%"=="%%I" Goto Start2
CLS
Echo.
Echo.
ECHO 出错啦,你的磁盘是不是没有分区呀?....先退出吧
Pause >nul
EXIT
:Start2
SET RPP=%RP%:
If Exist %RPP%\TCL_WIMTOOL rd %RPP%\TCL_WIMTOOL /s /q
md %RPP%\TCL_WIMTOOL
PECMD.EXE CALL $WimShExt.DLL
PECMD.EXE EXEC =!WIMTOOL.EXE /Reg /M
PECMD.EXE REGI HKCU\Software\WimTool\AutoMountPath=%RPP%\TCL_WIMTOOL\MountPath
PECMD.EXE REGI HKLM\SOFTWARE\PELOGON\FORCESHUTDOWN=#1
CLS
Echo.
Echo.
PECMD.EXE LOAD WIM.INI
ECHO 启用WIMTOOL功能成功,可以双击挂载WIM镜像文件啦,.....
Echo.
Pause >nul
以下是卸载所有WIM挂载项目的代码,并删除目标目录
以下代码保存为"卸载所有Wim.cmd"
@Echo Off
COLOR 2F
cd /d "%~dp0"
CLS
Echo.
Echo.
ECHO 确认要卸载所有已挂载的WIM映像文件吗,按任意键执行。。。
Pause >nul
Start /Wait WimTool.EXE /UnMount /All
For %%I In (Z z Y y W w V v U u T t S s R r Q q P p O o N n M m L l K k J j I i H h G g F f E e D d C c) Do If Exist %%I:\TCL_WIMTOOL rd %%I:\TCL_WIMTOOL /s /q
CLS
Echo.
Echo.
ECHO 所有WIM映像已卸载完成,并删除其目录,按任意键退出。。。
Pause >nul
WIM.INI文件中的内容:
FILE "%Desktop%\启用WIMTOOL.LNK"
LINK %Desktop%\Wim映像工具,%ProgramFiles%\WIMTOOL\WIMTOOL.EXE
LINK %Desktop%\卸载所有Wim映像,%ProgramFiles%\WIMTOOL\卸载所有Wim.cmd,,%ProgramFiles%\WIMTOOL\WIMTOOL.EXE