How transform path into unc-path ? 
Author Message
 How transform path into unc-path ?

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



Fri, 26 Mar 2004 18:37:49 GMT  
 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



Sat, 27 Mar 2004 22:41:51 GMT  
 How transform path into unc-path ?
You may also want to look at MSKB article Q192689


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



Sun, 28 Mar 2004 00:02:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Local path vs UNC Path

2. Converting logical paths to UNC paths

3. Help converting UNC paths to physical paths.

4. Converting logical paths to UNC paths

5. How to convert local path to UNC-path?

6. How to convert local path to UNC-path?

7. turning a local path into a UNC path

8. How to convert path to UNC path?

9. Set CurDir to UNC Path

10. get mapped drive letter from UNC path

11. UNC Path and DIR()

12. UNC path ( How to retrieve)

 

 
Powered by phpBB® Forum Software