Archives For unc path from network drive

I recently had a need in one of my programs to loop through all network drives on a computer and get the drive letter and the UNC path that the network drive mapped to. I thought this would be easy with the System.IO.DriveInfo.GetDrives method but unfortunately it was not as the DriveInfo class offers no way to retrieve the UNC path that the network drive maps to. After a bit of research I could find no better way than using a Windows API (I’m not a fan of WMI!). Here is some example VB.NET code that I have written that will do this:

Continue Reading…