我正在尝试自动化我们的成像过程。我们有多个具有不同图像的计算机型号,它们都存储在一个带有 WinPE 的 USB 驱动器上。我已经创建了一个脚本,它给了我选项Choice
来选择我想要成像的计算机,但问题是取决于我正在成像的计算机,USB 驱动器的字母会发生变化。我正在寻找一个批处理文件,它将找到 USB 驱动器并将驱动器号更改为“X:”,以便Choice
脚本可以使用静态驱动器号正常运行以查找图像文件。
我搜索并找到了一个脚本,该脚本将通过名称“Ace”找到 USB 驱动器并输出驱动器号,但无法弄清楚如何获取该驱动器并将其更改为“X:”
for /f "tokens=3 delims= " %%A in ('echo list volume ^| diskpart ^| findstr "Ace"') do (set Acedrive=%%A)
我到目前为止是这样的:
echo off
cls
Echo Image Selection Menu
Echo =======================
Echo 1 Dell D820
Echo 2 Dell E6510
Echo 3 Dell E6520
Echo 4 Lenovo T431S
Echo 5 Lenovo T440S
Echo 6 Lenovo M73 Tiny
Echo =======================
Choice /C 123456 /M "What computer are you trying to image?"
If Errorlevel 6 goto 6
If Errorlevel 5 goto 5
If Errorlevel 4 goto 4
If Errorlevel 3 goto 3
If Errorlevel 2 goto 2
If Errorlevel 1 goto 1
Goto End
:6
cls
imagex /apply M73.wim 1 g:
Goto End
:5
cls
imagex /apply T440S.wim 1 g:
Goto End
:4
cls
imagex /apply T431S.wim 1 g:
Goto End
:3
cls
imagex /apply E6520.wim 1 g:
Goto End
:2
cls
imagex /apply E6510.wim 1 g:
Goto End
:1
cls
imagex /apply D820.wim 1 g:
:End
所以这基本上只是让我选择我正在成像的计算机,然后为该 wim 运行相关的 imagex 命令。任何帮助将不胜感激!
谢谢