|
9#
楼主 |
发表于 2017-8-14 12:41:21
|
只看该作者
是不用安装的IMDISK地绿色版。
还有一个问题——如何在安装命令之后加上这一句让IMDISK直接自动加载win.iso?
IMDISK的安装命令——install.cmd:
@echo off
setlocal
title ImDisk 虚拟磁盘驱动器安装程序
echo ImDisk 虚拟磁盘驱动器安装程序
echo.
set IMDISK_TOTAL_DEVICES=0
set IMDISK_VALID_DEVICES=0
set IMDISK_PENDING_REMOVAL_DEVICES=0
if exist "%SystemRoot%\system32\imdisk.exe" (
for /f %%a in ('imdisk -l -n ^| find /v /i ^"No^"') do call :addline "%%a"
)
if %IMDISK_VALID_DEVICES% GTR 0 (
echo 已加载的 ImDisk 虚拟磁盘数量: %IMDISK_VALID_DEVICES%
echo.
if "%IMDISK_SILENT_SETUP%" == "1" (
echo 请在升级前弹出所有 ImDisk 虚拟磁盘 !
echo.
) else (
msgboxw "请在升级前弹出所有 ImDisk 虚拟磁盘 !" 16 "ImDisk-虚拟磁盘驱动器安装程序"
start control imdisk.cpl
)
endlocal
goto :eof
)
echo 已加载的 ImDisk 虚拟磁盘数量: %IMDISK_TOTAL_DEVICES%
echo.
if %IMDISK_TOTAL_DEVICES% == 0 (
net stop imdsksvc
net stop awealloc
net stop imdisk
if exist "%SystemRoot%\system32\taskkill.exe" taskkill /F /IM imdsksvc.exe
)
pushd "%~dp0"
rundll32 setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.inf
popd
if errorlevel 1 (
if not "%IMDISK_SILENT_SETUP%" == "1" msgboxw "安装失败。请重启计算机后再次尝试运行本程序。" 16 "ImDisk-虚拟磁盘驱动器安装程序"
endlocal
goto :eof
)
set IMDISK_START_FAILED=1
if %IMDISK_TOTAL_DEVICES% == 0 (
set IMDISK_START_FAILED=0
net start imdsksvc || set IMDISK_START_FAILED=1
net start awealloc || set IMDISK_START_FAILED=1
net start imdisk || set IMDISK_START_FAILED=1
)
if not "%IMDISK_SILENT_SETUP%" == "1" (
if %IMDISK_START_FAILED% == 0 (
msgboxw "安装成功。您可以在控制面板中打开 ImDisk 虚拟磁盘驱动器或使用 imdisk 命令行来管理您的虚拟磁盘!" 0 "ImDisk-虚拟磁盘驱动器安装程序"
) else (
msgboxw "安装完成, 但驱动程序或服务无法运行。请重启计算机后再次尝试运行本程序。" 16 "ImDisk-虚拟磁盘驱动器安装程序"
)
)
endlocal
goto :eof
:addline
imdisk -l -u %~1 > nul 2>&1
if errorlevel 1 (
set /a IMDISK_PENDING_REMOVAL_DEVICES=%IMDISK_PENDING_REMOVAL_DEVICES% + 1 > nul
) else (
set /a IMDISK_VALID_DEVICES=%IMDISK_VALID_DEVICES% + 1 > nul
)
set /a IMDISK_TOTAL_DEVICES=%IMDISK_TOTAL_DEVICES% + 1 > nul
goto :eof
在哪儿加上这一句:imdisk.exe -a -f U:\win.iso -m z:
应该如何加?让其在安装完IMDISK后直接自动装载win.iso? |
|