Network drive label

I am trying to get the label of some network shares displayed as drives. When I use DriveInfo.GetDrives () the local volumes have a populated VolumeLabel as expected, but on network drives it is an empty string. How can I get these tags?

0


source to share


2 answers


You can use WMI to do this - not sure about the exact query (it has been for a while), but here's an example of how to get free space on a network drive:

http://en.csharp-online.net/Network_Drive_Free_Space

I think that replacing "name" with "VolumeName" in this example will give you what you need.



The WMI link is here just in case:

http://msdn.microsoft.com/en-us/library/aa394173(VS.85).aspx

+1


source


Never use WMI Use net apis.



+1


source







All Articles