ManagementPath Class

Provides a wrapper for parsing and building paths to WMI objects.

Namespace: System.Management
Assembly: System.Management (in

Public Class ManagementPath
	Implements ICloneable
Dim instance As ManagementPath

public class ManagementPath implements ICloneable
public class ManagementPath implements ICloneable

The following example demonstrates how the ManagementPath class parses a path to a WMI object. The path that is parsed in the example is a path to an instance of a class.

Imports System
Imports System.Management

Public Class Sample
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer

        ' Get the WMI class path
        Dim p As ManagementPath = _
            New ManagementPath( _
            "\\ComputerName\root" & _

        Console.WriteLine("IsClass: " & _
        ' Should be False (because it is an instance)

        Console.WriteLine("IsInstance: " & _
        ' Should be True

        Console.WriteLine("ClassName: " & _
        ' Should be "Win32_LogicalDisk"

        Console.WriteLine("NamespacePath: " & _
        ' Should be "ComputerName\cimv2"

        Console.WriteLine("Server: " & _
        ' Should be "ComputerName"

        Console.WriteLine("Path: " & _
        ' Should be "ComputerName\root\cimv2:
        ' Win32_LogicalDisk.DeviceId="C:""

        Console.WriteLine("RelativePath: " & _
        ' Should be "Win32_LogicalDisk.DeviceID="C:""

    End Function
End Class


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions