Export (0) Print
Expand All

SWbemObject.Path_ property

The Path_ property of the SWbemObject object returns an SWbemObjectPath object that represents the object path of the current class or instance. This property can be passed as a parameter to methods that require an object path.

For an explanation of this syntax, see Document Conventions for the Scripting API.

This property is read-only.


SWbemObject.Path_ As Object

Property value


Only the Class property of the returned SWbemObjectPath instance can be modified. If you try to modify any other property, or try to call the methods SetAsClass or SetAsSingleton, you will get a wbemErrReadOnly error.

Because of this, you cannot modify the SWbemNamedValueSet object that is the value of the Keys property of the returned SWbemObjectPath instance. If you try to call the Add, Remove, or DeleteAll methods on this value, you will get a wbemErrReadOnly error. Furthermore, you cannot modify any SWbemNamedValue obtained from this collection. Attempts to modify the Value property return the same error code.

However, if you call SWbemObject.Clone_ to create a copy, the SWbemObjectPath.Path property of the copy is fully modifiable.


The following code sample, taken from List All the WMI cimV2 Classes in the TechNet Gallery, uses the Path_ property to list all the WMI cimV2 classes.

strComputer = "." 
Set objWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _  
    strComputer & "\root\cimv2") 
For Each objclass in objWMIService.SubclassesOf() 
    Wscript.Echo objClass.Path_.Class 


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Type library






© 2015 Microsoft