Jump to content

Check for WMI


ChrisL
 Share

Recommended Posts

Link to comment
Share on other sites

$strComputer = 'localhost'
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
If @error Then
    MsgBox(0,"Error", "Couldn't connect to WMI")
    Exit
EndIf

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • 1 year later...

Is there anyway to make the check give up quicker if a machine is slow to respond or not going to respond? For some machines I run this on, it takes ~30 seconds to time out. If not, could a timer be implemented somehow to cancel the call if no response if received?

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