Get drive label in C#

Posted by Rick on Stack Overflow See other posts from Stack Overflow or by Rick
Published on 2010-05-16T13:32:04Z Indexed on 2010/05/16 13:40 UTC
Read the original article Hit count: 438

Filed under:
|
|

When I use System.IO.DriveInfo.GetDrives() and look at the .VolumeLabel property of one of the drives, I see "PATRIOT XT", which is indeed the drive's volume label.

If I open "My Computer", instead I see "TrueCrypt Traveler Disk", and I can't seem to find any way to programmatically retrieve that value as none of the DriveInfo properties hold that value. I also tried querying the information via WMI's Win32_LogicalDisk, but no properties contained that value there either.

So any idea what the label My Computer uses is called, and more importantly, how to programmatically retrieve it?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about drive