WinPE中来自HTA的引导模式Legacy / UEFI

时间:2016-07-08 19:12:48

标签: vbscript hta legacy uefi winpe

尝试从HTA运行的WinPE中查看我是UEFI还是BIOS。我的出发点如下:

<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 个答案:

答案 0 :(得分:2)

找到以下作为我的解决方案:)

<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>