Boot Mode Legacy/UEFI from HTA in WinPE

不羁的心 提交于 2019-12-01 12:16:26

问题


Trying to see if I am in UEFI or BIOS from WinPE running from an HTA. My starting point below:

<script type='text/vbscript'>
Sub RegBOOT
If oReg.EnumValues(HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Control", "PEFirmwareType", "") = 1 Then
    BOOT.innerText = "Legacy BIOS"
If oReg.EnumValues(HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Control", "PEFirmwareType", "") = 2 Then
    BOOT.innerText = "UEFI"
End If
End Sub

</Script>
<BODY>
<p>You are in <span id="BOOT"></span> mode</p>
</BODY>

回答1:


Found the below as my solution that works :)

<script type='text/vbscript'>

Set objShell = CreateObject("WScript.Shell")                                             

Sub Window_Onload
RegB = objShell.regread("HKLM\System\CurrentControlSet\Control\PEFirmwareType")
If RegB = 1 Then
    Boot.innerhtml = "Legacy "
ElseIf RegB = 2 Then
    Boot.innerhtml = "UEFI "
Else
    Boot.innerhtml = "" & RegB & " "
End If
End Sub
</Script>
<body>

<H1>Running in <span id= "boot" class= "name"></span>mode</H1>
</BODY>


来源:https://stackoverflow.com/questions/38273847/boot-mode-legacy-uefi-from-hta-in-winpe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!