Boot Mode Legacy/UEFI from HTA in WinPE

后端 未结 1 1035
失恋的感觉
失恋的感觉 2021-01-17 01:35

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



        
相关标签:
1条回答
  • 2021-01-17 02:37

    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>
    
    0 讨论(0)
提交回复
热议问题