1. 程式人生 > >批處理判斷是BIOS還是UEFI啟動還是WINPE

批處理判斷是BIOS還是UEFI啟動還是WINPE

mic ystemd ios pan bios off fin ros log

@echo off
find /i "Detected boot environment" "%systemdrive%\windows\Panther\setupact.log" 1>nul 2>nul || echo 這是WINPE無法制作! && pause && exit /b
for /f "delims=" %%i in (‘find /i "Detected boot environment" "%systemdrive%\windows\Panther\setupact.log"‘) do set bootmode=%%i
set bootmode=%bootmode:~-4%


echo %bootmode%
if "%bootmode%"=="BIOS" (
echo BIOS啟動
) else (
echo UEFI啟動
)
pause

批處理判斷是BIOS還是UEFI啟動還是WINPE