getting share name of local drive 
Author Message
 getting share name of local drive

Is there a way to get the share name of a local drive?

I need to pass a local drive's UNC  to a server.

Thanks for your help in advance.



Tue, 12 Feb 2002 03:00:00 GMT  
 getting share name of local drive
Check this Page

http://personal.redestb.es/varela/visual.htm

Contain some examples that you need


Quote:
> Is there a way to get the share name of a local drive?

> I need to pass a local drive's UNC  to a server.

> Thanks for your help in advance.



Tue, 12 Feb 2002 03:00:00 GMT  
 getting share name of local drive
This only works for mapped network drives.  I need one that will give me
what my C drive's share name is.


Fri, 15 Feb 2002 03:00:00 GMT  
 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.



Fri, 15 Feb 2002 03:00:00 GMT  
 getting share name of local drive
Hi Paul!

I've already tried this and this is precisely why I need the share name of
my c drive.  The c drive may not necessarily be named the same.   When you
share your c drive, you can name it however you want.  This is separate from
the administrative share.  I need to create the UNC of my C drive how it is
viewed from the network.  I've noticed that getting the sharename of a drive
is limited only to a remote drive.

Thanks for your patience.

Gennie



Fri, 15 Feb 2002 03:00:00 GMT  
 getting share name of local drive
I already found a solution from another newsgroup.
Here it is...

---------------------------------------
Look in registry
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\LanmanServer\Shares
---------------------------------------


Quote:
> Is there a way to get the share name of a local drive?

> I need to pass a local drive's UNC  to a server.

> Thanks for your help in advance.

> using vb6



Fri, 15 Feb 2002 03:00:00 GMT  
 getting share name of local drive
Hi, Gennie.

That may work for you, but it isn't going to be reliable on all systems. I
don't have that registry key, so it wouldn't work for me.

WNetGetUniversalName looks as though it should do what you want, but I've
yet to figure out how to get it working.

Anyone out there have any info on this API ?

--

Regards, Paul.


www.gooch.co.uk


Quote:
> I already found a solution from another newsgroup.
> Here it is...

> ---------------------------------------
> Look in registry
> HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\LanmanServer\Shares
> ---------------------------------------



> > Is there a way to get the share name of a local drive?

> > I need to pass a local drive's UNC  to a server.

> > Thanks for your help in advance.

> > using vb6



Sat, 16 Feb 2002 03:00:00 GMT  
 getting share name of local drive
Just so you don't waste too much time on the API call, it doesn't work
under Win95. See
http://support.microsoft.com/support/kb/articles/Q131/4/16.asp for more
details.

Quote:

> Hi, Gennie.

> That may work for you, but it isn't going to be reliable on all systems. I
> don't have that registry key, so it wouldn't work for me.

> WNetGetUniversalName looks as though it should do what you want, but I've
> yet to figure out how to get it working.

> Anyone out there have any info on this API ?

> --

> Regards, Paul.


> www.gooch.co.uk



> > I already found a solution from another newsgroup.
> > Here it is...

> > ---------------------------------------
> > Look in registry
> > HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\LanmanServer\Shares
> > ---------------------------------------



> > > Is there a way to get the share name of a local drive?

> > > I need to pass a local drive's UNC  to a server.

> > > Thanks for your help in advance.

> > > using vb6

--

Beer, Wine and Database Programming.  What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://webhome.idirect.com/~djsteele/



Thu, 16 May 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. getting share name of a local drive

2. getting share name of a local drive

3. local drive letter <> drive share name

4. What is the Share-Name of a local drive

5. What is the Share-Name of a local drive

6. What is network share name of local drive

7. Retreiving The Shared Directory Name On A Local Drive

8. Help Obtaining Local Drive UNC or Share Name

9. Getting share name for a local resource

10. Need help copying files from shared drive to local drive

11. Show Local AND Shared (network) drives in Browseforfolder

12. Browseforfolder should show only local and shared drives

 

 
Powered by phpBB® Forum Software