הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
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.