WINPE中批处理判断是BIOS还是UEFI启动

UEFI and BIOS modes in WinPE
Detect if WinPE is booted into BIOS or UEFI Mode
Query the registry to determine which mode the device is in. You can do this from the command line:


Copy
reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType
Return code    Firmware mode
0x1    BIOS
0x2    UEFI
Use it in a script:


Copy
wpeutil UpdateBootInfo
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.


Note that between delims= and " %%A is a tab, followed by a space.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值