PDA

View Full Version : Extracting hostname from mapped drive variable



CaseyR
04-03-2006, 11:38 AM
A registry entry I want to use needs the UNC hostname and path to the folder, but my users will often just select a mapped drive. Can SB extract the host and folderpath name from, say, the PROGDIR variable so it can be used in the Registry.

For context, I need the registry entry so that end users can open a specific chm help file located on a different machine without permitting all chm files to be opened.

Any suggestions would be very much appreciated.

Thanks.

linder
04-04-2006, 04:11 AM
Hello,

Please see String Functions (Extract Server Name and Extract Share Name).

Does this help?

CaseyR
04-04-2006, 11:44 AM
Thanks, Freidrich, that's half the battle. The Extract Server Name and Share Name functions use the UNC for the shared resource. First, I need to convert the mapped drive its UNC equivalent. Any suggestions?

linder
04-05-2006, 08:51 AM
Perhaps a DLL Call to Windows Networking WNetGetUniversalName (MPR.DLL) API?