
How transform path into unc-path ?
You can use the API-function WNetGetConnection().
the api-declare:
Private Declare Function WNetGetConnection Lib "mpr.dll" Alias
"WNetGetConnectionA" (ByVal lpszLocalName As String, ByVal lpszRemoteName As
String, cbRemoteName As Long) As Long
the code:
Dim Remote As String
Dim RemoteLen As Long
Dim Ret As Long
Dim Letter As String
Dim nPek As Integer
RemoteLen = 255
Remote = Space(RemoteLen)
Letter = "P:"
Ret = WNetGetConnection(Letter, Remote, RemoteLen)
nPek = InStr(Remote, Chr(0))
If nPek > 0 Then
Remote = Left(Remote, nPek - 1)
End If
Hope you understand this.
/Peo
Quote:
> Hi,
> How can i transform a path (for example p:\temp\, which is
> a connection to a network-drive) in a unc-path ?
> Thanks,
> ivo