I'm using WMI to get info about hard drives on a computer but I just can't find the property that will allow me to identify which hard drive is used as system drive where Windows is installed.
ManagementObjectSearcher mos_HDD = new ManagementObjectSearcher("select * from Win32_DiskDrive");
I tried iterating through all properties but neither one looks like it holds the info I need.
foreach (ManagementObject mo_HDD in mos_HDD.Get())
{
Console.WriteLine("HDD Properties:");
foreach (PropertyData pd in mo_HDD.Properties)
{
Console.WriteLine("\tName: {0} \tValue: {1}", pd.Name, pd.Value != null ? pd.Value.ToString() : "NULL");
}
}
I've also looked at MSDN documentation but w/o luck.
What I'm trying to do here is to get some kind of identifier for a system drive (such as Signature or Serial number).
Any help to get this info is highly appreciated.
Best Answer
you can get it as :