1

I want to be able to get the UNC path of a mapped drive. For example, if I have the Q: drive mapped to a share on a remote host, I want to check to see not only if the Q: drive exists, but I want to find out what UNC path it is actually mapped to.

Checking to see if the drive exists is easy enough with:

Directory.Exists(@"Q:\")

But can't figure out how to get the share name (full UNC path). I don't have a file to search for.

  • 3
    Perhaps this will help http://stackoverflow.com/questions/2067075/how-do-i-determine-a-mapped-drives-actual-path – hawkstrider Oct 08 '15 at 20:46
  • 1
    That information is in the registry.You can simply read the registry. https://pattersonsupport.custhelp.com/app/answers/detail/a_id/8981/~/viewing-the-unc-path-for-a-mapped-drive – Hozikimaru Oct 08 '15 at 21:39
  • That information only seems to be in the registry HKEY_CURRENT_USER\Network\Q if the drive (in my case the "Q" drive letter) is mapped "persistent" if not, i can't seem to find it in the registry. Is there some type of "temporary" registry, or does anyone know where "non-persistent" mappings are stored? – user3758081 Oct 15 '15 at 21:30

0 Answers0