Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can create an object for WMI in Visual Basic Scripting Edition (VBScript) by connecting to WMI and then calling CreateObject. The following table lists the methods in the Scripting API for WMI that support object creation.
Interface | ProgID |
---|---|
SWbemDateTime | "WbemScripting.SwbemDateTime" |
SWbemLocator | "WbemScripting.SWbemLocator" |
SWbemLastError | "WbemScripting.SWbem.LastError" |
SWbemObjectPath | "WbemScripting.SWbemObjectPath" |
SWbemNamedValueSet | "WbemScripting.SWbemNamedValueSet" |
SWbemRefresher | "WbemScripting.SWbemRefresher" |
SWbemSink | "WbemScripting.SWbemSink" |
The following procedure describes how to create a WMI object using VBScript.
To create a WMI object using VBScript
Connect to WMI using either a moniker or an SWbemLocator object.
For more information, see Creating a WMI Script.
Make a call to the VBScript CreateObject method.
The following code example shows how to create an object.
Set locator = CreateObject("WbemScripting.SWbemLocator")
If you use a moniker in Step 1, you do not need to call CreateObject again.
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!