從命令列掛載 ISO 並在 Windows 8 中取得其磁碟機代號

從命令列掛載 ISO 並在 Windows 8 中取得其磁碟機代號

我正在製作一個批次腳本,它安裝 ISO 檔案並從安裝位置安裝應用程式(VS 2012),如下所示:

K:\Softwares\VS12.iso
%DRIVE_LETTER%:\vs_ultimate.exe /passive /norestart

但問題是取得ISO掛載的盤符。有人知道如何取得磁碟機號嗎?

答案1

嘗試這個:

for /f "tokens=3 delims=\:" %%d in ('reg query hklm\system\mounteddevices ^| findstr /c:"5C003F00" ^| findstr /v "{.*}"') do (  
    if exist %%d:\vs_ultimate.exe %%d:\vs_ultimate.exe /passive /norestart
)

相關內容