#include MsgBox (1, "You Are Running " & @OSVersion & " Build " & @OSBuild, "The Firmware Type Is " & GetFirmwareType ()) Func GetFirmwareType () $gftreturn = "UEFI" Select Case @OSBuild > 20000 ; Windows 11 Case @OSBuild > 9000 ; Windows 10 or 8 $gftarray = DllCall ("Kernel32.dll", "int", "GetFirmwareType", "int*", 0) If @error Or Ubound ($gftarray) < 2 Then Return "ERROR" If $gftarray [1] <> 2 Then $gftreturn = "BIOS" Case @OSBuild > 6000 ; Windows 7 or Vista DllCall ("kernel32.dll", "int", "GetFirmwareEnvironmentVariableA", "str", "", "str", _ "{00000000-0000-0000-0000-000000000000}", "ptr", Null, "dword", 0) $gftcode = _WinAPI_GetLastError () If $gftcode = 1 Then $gftreturn = "BIOS" Case Else ; XP $gftreturn = "BIOS" EndSelect Return $gftreturn EndFunc