CODE: [Copy to clipboard]
@echo off
if "%PROCESSOR_ARCHITECTURE:~-2%"=="86" goto 32
if "%PROCESSOR_ARCHITECTURE:~-2%"=="64" goto 64
:32
copy /y ISODrive.sys %SystemRoot%\system32\drivers\>nul 2>nul
goto Common
:64
copy /y ISODrv64.sys %SystemRoot%\system32\drivers\>nul 2>nul
:Common
echo 正在复制文件. . .
copy /y IsoCmd.exe %SystemRoot%\system32\>nul 2>nul
echo 正在安装服务. . .
%SystemRoot%\system32\IsoCmd.exe -i>nul 2>nul
echo 设置驱动器数量. . .
%SystemRoot%\system32\IsoCmd.exe -number 1
echo 设置驱动器卷标. . .
%SystemRoot%\system32\IsoCmd.exe -change 1 X:
echo 正在关联镜像. . .
reg add "HKCR\.bin" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.cue" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.ccd" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.img" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.iso" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.isz" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.mdf" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.mds" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\.nrg" /f /ve /t REG_SZ /d "VDI">nul 2>nul
reg add "HKCR\VDI\shell\虚拟光驱(&V)\command" /f /ve /t REG_SZ /d "%SystemRoot%\system32\IsoCmd.exe -mount X: \"%%1\"">nul 2>nul
reg add "HKCR\Drive\shell\卸载光驱(&V)\command" /f /ve /t REG_EXPAND_SZ /d "%SystemRoot%\system32\IsoCmd.exe -eject X:">nul 2>nul
pause