Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

DllCall MS MDT 2012 Microsoft.BDD.Utility.dll

$
0
0

Hi folks,

 

Please can someone help.  I found the following web article, which explains what I'm trying to do - except I want to do this natively within AutoIt code instead of using the VBS that the link provides: http://www.verboon.info/index.php/2012/12/exploring-the-functions-included-in-microsoft-bdd-utility-dll/

 

I've been trying to make this work, but so far unsuccessfully.  I just keep getting the @error code set to 1 and no results.  My attempts are here:

AutoIt         
If @OSArch = "X86" Then     $sDllName = @ScriptDir & "\x86Microsoft.BDD.Utility.dll" ElseIf @OSArch = "X64" Then     $sDllName = @ScriptDir & "\x64Microsoft.BDD.Utility.dll" EndIf ;~ $oShell = ObjCreate("WScript.Shell") ;~ $sDllName = @ScriptDir & "\Microsoft.BDD.Utility.dll" ;~ $oShell.Run ("regsvr32.exe /s """ & $sDllName & """", 0, 1) ;~ $oBDDUtility = ObjCreate("Microsoft.BDD.Utility") ;~ $dll = DllOpen($sDllName) ;~ $sIsUEFI = DllCall($dll, "int", "IsUEFI") $sIsUEFI = DllCall($sDllName, "int", "IsUEFI") ;~ $sSupports64Bit = DllCall($dll, "int", "Supports64Bit") MsgBox(0, "", @error) If IsArray($sIsUEFI) Then MsgBox(0, "", "UEFI: " & $sIsUEFI[0]) ;~ MsgBox(0, "", "Supports64Bit: " & $sSupports64Bit) ;~ DllClose($dll) Exit ;~ $bIsUEFI = 0 ;~ $bIsUEFI = $oBDDUtility.IsUEFI ;~ $bIsAdmin = 0 ;~ $bIsAdmin = $oBDDUtility.IsAdmin ;~ $bIsHyperVirsorRunning = 0 ;~ $bIsHyperVirsorRunning = $oBDDUtility.IsHypervisorRunning ;~ $bSupportsNX = 0 ;~ $bSupportsNX  = $oBDDUtility.SupportsNX ;~ $bSupportsVT = 0 ;~ $bSupportsVT = $oBDDUtility.SupportsVT ;~ $bSupports64Bit = 0 ;~ $bSupports64Bit = $oBDDUtility.Supports64Bit ;~ $bIs64Bit = 0 ;~ $bIs64Bit = $oBDDUtility.Is64Bit ;~ ConsoleWrite("UEFI: " & $bIsUEFI & @CRLF) ;~ ConsoleWrite("Is Admin: " & $bIsAdmin & @CRLF) ;~ ConsoleWrite("Is HyperVisor Running: " & $bIsHyperVirsorRunning & @CRLF) ;~ ConsoleWrite("Supports NX: " & $bSupportsNX & @CRLF) ;~ ConsoleWrite("Supports VT: " & $bSupportsVT & @CRLF) ;~ ConsoleWrite("Supports 64 Bit: " & $bSupports64Bit & @CRLF) ;~ ConsoleWrite("Is 64 Bit: " & $bIs64Bit & @CRLF)

Can anyone help me understand where I'm going wrong with this?  I did try searching the forums for answers first, but couldn't find anything related to this particular dll.

 

Basically, I want to use this MDT dll to determine if the machine is running in UEFI or BIOS mode.  Any help or advice is greatfully received!

 

Many thanks,

 

G.


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>