I was expecting this to be easy but it seems that it is not... all I want to do is loop through all drives on a computer and if the drive is a network drive then get the UNC path that this network drive maps to. Simples.
I was expecting to just do this:
vb.net Code:
For Each drv In IO.DriveInfo.GetDrives()
If drv.DriveType = IO.DriveType.Network Then
MessageBox.Show(drv.RootDirectory.ToString)
End If
Next
but this just outputs the drive letters like so:
So does anyone know of any way to get the path that the network drive maps to (e.g \\server\someshare\somedirectory) without using WMI ?
Thanks
Chris