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!

how to get the UNC from the mapped drive letter?

Status
Not open for further replies.

Alockhart

Programmer
Sep 12, 2002
16
CA
I am trying to find a way to get the UNC by using the drive letter.
On our servers everyone has a common drive letter but depending on where you are it could be on different servers plus it is also includes your username.

Does anyone know how to look this up in VB6?

Thanks

Andrew
 
msgbox CreateObject("scripting.filesystemobject").GetDrive("mapped_drive_letter").ShareName
 
that worked great but is there a way of making is public for the whole program?

Right now I have code to set my path at the very top of the program but when I put this line of code in it complains about GetDrive("U:").


 
on a Module
Public strUNC as String

strUNC =CreateObject("scripting.filesystemobject").GetDrive(mapped_drive_letter).ShareName

set also the path, other info you need accessible through your program and forget "at the very top of the program"!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top