Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find UNC Name from Commondialog...

Status
Not open for further replies.

Ajb2528

Technical User
Feb 22, 2002
270
GB
I am trying to obtain the unc path from a path returned from the commondialog box and I am up against a brick wall.. has anyone got ideas on how to do this....

Regards,

Alan
 
You can use the win API WNetGetUniversalName() to return the UNC name for a drive that is "mapped" to a "local" drive (C->Z).
 
Hey Alan,

You may have already answered this, but I just ran into the same brick wall. Here's what I ended up doing. The UNC path was showing in the path of the "DriveListBox.Drive". I just editted it out and added on the Folder & File Name.

UNCPath = Mid(driveSet.Drive, InStr(1, driveSet.Drive, "[", vbTextCompare) + 1, Len(driveSet.Drive) - (InStr(1, driveSet.Drive, "[", vbTextCompare) + 1))

Hope this helps you out some!!
Stacy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top