Ventoy Forums
批处理,一件加载ISO至指定盘符,适用于Gandalf那个PE - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: 批处理,一件加载ISO至指定盘符,适用于Gandalf那个PE (/showthread.php?tid=1644)



批处理,一件加载ISO至指定盘符,适用于Gandalf那个PE - try_catch - 04-12-2021

使用VENTOY启动Gandalf PE之后。并不能自动加载ISO至Y盘。于是写了个批处理。利用Gandalf PE卷标“Win10PESE” 自动加载ISO同时调整至Y盘盘符

批处理需要和ISO放置同一路径。同时需要修改ISO文件名

@echo off & setlocal enabledelayedexpansion


cd /d "%~dp0"
SET CurDir=%CD%

explorer.exe "%CurDir%\Windows_PE_Gandalf_tools.iso"

ping 127.1 -n 5 >nul

for %%i in (Z Y X W V U T S R Q P O N M L K J I H G F E D C) do (
  vol %%i:|findstr "Win10PESE">nul&& set drivername=%%i:\)


mountvol >%CurDir%\volname.txt

for /f "delims=" %%j in ('type "%CurDir%\volname.txt"') do (
set "str=%%j"
>>$ echo,!str: =!
)
move $ "%CurDir%\volname.txt" >nul

for /f "delims=" %%c in (%CurDir%\volname.txt) do if "%%c"=="%drivername%" (set guid=!char! &goto :end) else (set char=%%c)


:end
echo %drivername%
echo %guid%
echo y | del %CurDir%\volname.txt
mountvol %drivername% /D
mountvol Y:\ %guid%
pause >nul