
getting share name of local drive
Hi, Gennie.
Some quoted text makes it easier to see what you're responding to.
You could use the GetComputerName API to return the name of NetBios name of
the local machine, then append the drive to it.
Add the API to a module :
Public Declare Function GetComputerName Lib "kernel32" Alias
"GetComputerNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
To get the computer name use :
Private Function LocalComputerName() As String
Dim ret As Long
Dim lpBuffer As String
lpBuffer = String(128, 0)
ret = GetComputerName(lpBuffer, 1024)
LocalComputerName = lpBuffer
End Function
Something like the following should work :
UNCname = "//" & GetComputerName & "/" & <drive letter>
--
Regards, Paul.
www.gooch.co.uk
Quote:
> This only works for mapped network drives. I need one that will give me
> what my C drive's share name is.