Drive from Volume Label

togatown

New member
Joined
May 13, 2007
Messages
2
Programming Experience
Beginner
I know how to easily get a volume label if I know the drive letter, is there a way to get the drive letter easily if I know the volume label?

Thanks
 
You can get them all from System.IO.DriveInfo class. Iterate the GetDrives method and check Name and VolumeLabel properties. Note that you can only read VolumeLabel if drive IsReady (yes, it's a property).
 
No need to use the Scripting FileSystemObject when .Net library have native support for it. DriveInfo is new with .Net 2.0 though, so many .Net programmers used Scripting with earlier versions.
 
Back
Top