Path Property
Collapse the table of content
Expand the table of content

ManagementObject.Path Property

Gets or sets the object's WMI path.

[Visual Basic]
Public Overridable Property Path As ManagementPath
[C#]
public virtual ManagementPath Path {get; set;}
[C++]
public: __property virtual ManagementPath* get_Path();
public: __property virtual void set_Path(ManagementPath*);
[JScript]
public function get Path() : ManagementPath;
public function set Path(ManagementPath);

Property Value

A ManagementPath representing the object's path.

Remarks

Changing the property after the management object has been bound to a WMI object in a particular namespace results in releasing the original WMI object. This causes the management object to be rebound to the new object specified by the new path properties and scope values.

The rebinding is performed in a "lazy" manner, that is, only when a requested value requires the management object to be bound to the WMI object. Changes can be made to more than just the property before attempting to rebind (for example, modifying the scope and path properties simultaneously).

Example

[C#] 
ManagementObject o = new ManagementObject(); 

//Specify the WMI path to which this object should be bound to
o.Path = new ManagementPath("MyClass.Name='foo'");
   
[Visual Basic] 
Dim o As New ManagementObject()

'Specify the WMI path to which this object should be bound to
o.Path = New ManagementPath("MyClass.Name=""foo""");
   

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ManagementObject Class | ManagementObject Members | System.Management Namespace

Show:
© 2016 Microsoft