Click here to Skip to main content
15,918,243 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am totally confused and really dont know how to do this because there is no way in WMI class for do this

Do You have any Idea ???
Posted

You need to use the association classes Win32_DiskDriveToDiskPartition and Win32_LogicalDiskToPartition to correlate a physical disk with a volume:
http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/23/how-can-i-correlate-logical-drives-and-physical-disks.aspx[^]
 
Share this answer
 
v2
There are all the WMI classes to cover it all. The problem is your understanding of how a disk is used. Not as you think. The drive letters are not associated with disk drives. They are associated with logical volumes, so the class is CIM_StorageVolume. The drive is subdivided into partitions, and so one. To use WMI, you need to learn them all.

As to WMI representation of all those objects, you can start from a place like this one
http://msdn.microsoft.com/en-us/library/aa394132%28v=vs.85%29.aspx[^]
and then find all the other relevant classes:
http://msdn.microsoft.com/en-us/library/aa394570%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/aa394388%28v=vs.85%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900