Get classpath of WMI class in c#

 

 

            // Schema query for getting infomation for Win32_LogicalDisk class

            ManagementObjectSearcher q = new ManagementObjectSearcher(@"SELECT * FROM meta_class WHERE __this ISA ""Win32_LogicalDisk""");

 

            // get the each class from the select query.

            foreach (ManagementClass c in q.Get())

            {

 

             // it displays the classpath

                MessageBox.Show(c.ClassPath.ToString());

            }