@echo off
cls
color 1f
wpeutil /UpdateBootInfo 2> nul
if errorlevel 1 echo wpeutil not found - Please run under WinPE only & pause & goto :EOF
for /f "tokens=2* delims=  " %%A in ('reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType') DO SET Firmware=%%B
:: Note: delims is a TAB followed by a space.
if "%Firmware%"=="0x1" echo The PC is booted in BIOS mode.
if "%Firmware%"=="0x2" echo The PC is booted in UEFI mode.
pause
