Jump to content

How to use WMI in AutoIT


Recommended Posts

I have seen that few scripts written in this foram are mentioning re: WMI. I have seen a code like :

$wbemFlagReturnImmediately = 0x10

$wbemFlagForwardOnly = 0x20

$colItems = ""

$strComputer = "localhost"

$Output=""

$Output = $Output & "Computer: " & $strComputer & @CRLF

$Output = $Output & "==========================================" & @CRLF

$objWMIService = ObjGet("winmgmts:\" & $strComputer & "rootCIMV2")

$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", _

$wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then

For $objItem In $colItems

$Output = $Output & "AddressWidth: " & $objItem.AddressWidth & @CRLF

$Output = $Output & "Architecture: " & $objItem.Architecture & @CRLF

$Output = $Output & "Availability: " & $objItem.Availability & @CRLF

$Output = $Output & "Caption: " & $objItem.Caption & @CRLF

$Output = $Output & "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & @CRLF

$Output = $Output & "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & @CRLF

$Output = $Output & "CpuStatus: " & $objItem.CpuStatus & @CRLF

Can anybody help me regarding how to use WMI in AutoIT scripts step-by-step.

Is there any DLL required and if yes then how to load it.

I not able to compile the scripts.

Please help me re: WMI into AutoIT.

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...