local drive letter <> drive share name 
Author Message
 local drive letter <> drive share name

I need to build a lookup table of local drive letter <> drive sharename.

drive share name = the name appearing under property page Explorer > Sharing

Quote:
> Share As: Share Name.

I can enumerate the share names with IShellFolder - but don't see any way to
get the associated local drive letter.
I can enumerate the local drives with GetLogicalDrives or File Scripting
Host - but don't see any way to get the share name.

WNetGetConnection doesn't work - the share may not be mapped.
Same for WNetOpenEnum, WNetEnumResource .

I know the data is in registry under (W9x - not sure under NT, W2K & XP)
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Network\LanMan
but registry browsing doesn't seem like a smart way to do this.

Can anyone point me to information about how to accomplish this?

Thanks,

--
Dale Sampson
http://www.*-*-*.com/



Mon, 12 Jul 2004 13:58:46 GMT  
 local drive letter <> drive share name
I can tell you that under NT/2000/XP you can use the NetShareEnum to
retrieve this info for the local or remote machines ... see
http://www.mvps.org/vbnet/code/network/netshareenum.htm .. the first col
displayed is the share, the last the physical path.

--

Randy Birch
MVP Visual Basic

http://www.mvps.org/vbnet/

Please respond only to the newsgroups so all can benefit.


Quote:
> I need to build a lookup table of local drive letter <> drive sharename.

> drive share name = the name appearing under property page Explorer >
Sharing
> > Share As: Share Name.

> I can enumerate the share names with IShellFolder - but don't see any way
to
> get the associated local drive letter.
> I can enumerate the local drives with GetLogicalDrives or File Scripting
> Host - but don't see any way to get the share name.

> WNetGetConnection doesn't work - the share may not be mapped.
> Same for WNetOpenEnum, WNetEnumResource .

> I know the data is in registry under (W9x - not sure under NT, W2K & XP)

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Network\LanMan

- Show quoted text -

Quote:
> but registry browsing doesn't seem like a smart way to do this.

> Can anyone point me to information about how to accomplish this?

> Thanks,

> --
> Dale Sampson
> http://www.dalesplace.net/download/



Mon, 12 Jul 2004 14:07:12 GMT  
 local drive letter <> drive share name
Thank you Randy! - I missed this  when I was nosing around your site
earlier.

This works fine for the NT OSs - now for with W9x machines .....

Some how it doesn't seem like this should be this hard.

Thanks again,

--
Dale Sampson
http://www.dalesplace.net/download/


Quote:
> I can tell you that under NT/2000/XP you can use the NetShareEnum to
> retrieve this info for the local or remote machines ... see
> http://www.mvps.org/vbnet/code/network/netshareenum.htm .. the first col
> displayed is the share, the last the physical path.

> --

> Randy Birch
> MVP Visual Basic

> http://www.mvps.org/vbnet/

> Please respond only to the newsgroups so all can benefit.



> > I need to build a lookup table of local drive letter <> drive sharename.

> > drive share name = the name appearing under property page Explorer >
> Sharing
> > > Share As: Share Name.

> > I can enumerate the share names with IShellFolder - but don't see any
way
> to
> > get the associated local drive letter.
> > I can enumerate the local drives with GetLogicalDrives or File Scripting
> > Host - but don't see any way to get the share name.

> > WNetGetConnection doesn't work - the share may not be mapped.
> > Same for WNetOpenEnum, WNetEnumResource .

> > I know the data is in registry under (W9x - not sure under NT, W2K & XP)

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Network\LanMan

- Show quoted text -

Quote:
> > but registry browsing doesn't seem like a smart way to do this.

> > Can anyone point me to information about how to accomplish this?

> > Thanks,

> > --
> > Dale Sampson
> > http://www.dalesplace.net/download/



Mon, 12 Jul 2004 15:13:10 GMT  
 local drive letter <> drive share name
The 9x version is at
http://www.mvps.org/vbnet/code/network/wnetenumresource.htm

--

Randy Birch
MVP Visual Basic

http://www.mvps.org/vbnet/

Please respond only to the newsgroups so all can benefit.


Quote:
> Thank you Randy! - I missed this  when I was nosing around your site
> earlier.

> This works fine for the NT OSs - now for with W9x machines .....

> Some how it doesn't seem like this should be this hard.

> Thanks again,

> --
> Dale Sampson
> http://www.dalesplace.net/download/



> > I can tell you that under NT/2000/XP you can use the NetShareEnum to
> > retrieve this info for the local or remote machines ... see
> > http://www.mvps.org/vbnet/code/network/netshareenum.htm .. the first col
> > displayed is the share, the last the physical path.

> > --

> > Randy Birch
> > MVP Visual Basic

> > http://www.mvps.org/vbnet/

> > Please respond only to the newsgroups so all can benefit.



> > > I need to build a lookup table of local drive letter <> drive
sharename.

> > > drive share name = the name appearing under property page Explorer >
> > Sharing
> > > > Share As: Share Name.

> > > I can enumerate the share names with IShellFolder - but don't see any
> way
> > to
> > > get the associated local drive letter.
> > > I can enumerate the local drives with GetLogicalDrives or File
Scripting
> > > Host - but don't see any way to get the share name.

> > > WNetGetConnection doesn't work - the share may not be mapped.
> > > Same for WNetOpenEnum, WNetEnumResource .

> > > I know the data is in registry under (W9x - not sure under NT, W2K &
XP)

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Network\LanMan

- Show quoted text -

Quote:
> > > but registry browsing doesn't seem like a smart way to do this.

> > > Can anyone point me to information about how to accomplish this?

> > > Thanks,

> > > --
> > > Dale Sampson
> > > http://www.dalesplace.net/download/



Tue, 13 Jul 2004 07:02:12 GMT  
 local drive letter <> drive share name
Hi Randy,

Again, thank you for the help.

Maybe I'm missing something, but I don't see anyway to use WNetOpenEnum,
WNetEnumResource to obtain the share names of the local drives. As near as I
can tell, this only works to enum local logical drives mapped to external
shares.

--
Dale Sampson
http://www.dalesplace.net/download/


Quote:
> The 9x version is at
> http://www.mvps.org/vbnet/code/network/wnetenumresource.htm

> --

> Randy Birch
> MVP Visual Basic

> http://www.mvps.org/vbnet/

> Please respond only to the newsgroups so all can benefit.



> > Thank you Randy! - I missed this  when I was nosing around your site
> > earlier.

> > This works fine for the NT OSs - now for with W9x machines .....

> > Some how it doesn't seem like this should be this hard.

> > Thanks again,

> > --
> > Dale Sampson
> > http://www.dalesplace.net/download/



> > > I can tell you that under NT/2000/XP you can use the NetShareEnum to
> > > retrieve this info for the local or remote machines ... see
> > > http://www.mvps.org/vbnet/code/network/netshareenum.htm .. the first
col
> > > displayed is the share, the last the physical path.

> > > --

> > > Randy Birch
> > > MVP Visual Basic

> > > http://www.mvps.org/vbnet/

> > > Please respond only to the newsgroups so all can benefit.



> > > > I need to build a lookup table of local drive letter <> drive
> sharename.

> > > > drive share name = the name appearing under property page Explorer >
> > > Sharing
> > > > > Share As: Share Name.

> > > > I can enumerate the share names with IShellFolder - but don't see
any
> > way
> > > to
> > > > get the associated local drive letter.
> > > > I can enumerate the local drives with GetLogicalDrives or File
> Scripting
> > > > Host - but don't see any way to get the share name.

> > > > WNetGetConnection doesn't work - the share may not be mapped.
> > > > Same for WNetOpenEnum, WNetEnumResource .

> > > > I know the data is in registry under (W9x - not sure under NT, W2K &
> XP)

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Network\LanMan

- Show quoted text -

Quote:
> > > > but registry browsing doesn't seem like a smart way to do this.

> > > > Can anyone point me to information about how to accomplish this?

> > > > Thanks,

> > > > --
> > > > Dale Sampson
> > > > http://www.dalesplace.net/download/



Tue, 13 Jul 2004 13:08:38 GMT  
 local drive letter <> drive share name
I have tried to find the answer for the same question for over a year now,
without success. So I have finally decided to read the registry. On NT and
W2K the shares are in
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Shares.

Janne



Quote:
> I need to build a lookup table of local drive letter <> drive sharename.

> drive share name = the name appearing under property page Explorer >
Sharing
> > Share As: Share Name.

> I can enumerate the share names with IShellFolder - but don't see any way
to
> get the associated local drive letter.
> I can enumerate the local drives with GetLogicalDrives or File Scripting
> Host - but don't see any way to get the share name.

> WNetGetConnection doesn't work - the share may not be mapped.
> Same for WNetOpenEnum, WNetEnumResource .

> I know the data is in registry under (W9x - not sure under NT, W2K & XP)

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Network\LanMan

- Show quoted text -

Quote:
> but registry browsing doesn't seem like a smart way to do this.

> Can anyone point me to information about how to accomplish this?

> Thanks,

> --
> Dale Sampson
> http://www.dalesplace.net/download/



Tue, 13 Jul 2004 14:33:47 GMT  
 local drive letter <> drive share name
Hi Janne,

Appreciate the tip.

I'm thinking along the lines of a 'hybrid -  use Randy's code from
http://www.mvps.org/vbnet/code/network/netshareenum.htm ..  for everything
except Win95/98 & then enum the registry for 95/98Me.

I'll keep looking for how to do it 'right' - if I stumble on something I'll
post it here ....

--
Dale Sampson
http://www.dalesplace.net/download/


Quote:
> I have tried to find the answer for the same question for over a year now,
> without success. So I have finally decided to read the registry. On NT and
> W2K the shares are in
> HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Shares.

> Janne



> > I need to build a lookup table of local drive letter <> drive sharename.

> > drive share name = the name appearing under property page Explorer >
> Sharing
> > > Share As: Share Name.

> > I can enumerate the share names with IShellFolder - but don't see any
way
> to
> > get the associated local drive letter.
> > I can enumerate the local drives with GetLogicalDrives or File Scripting
> > Host - but don't see any way to get the share name.

> > WNetGetConnection doesn't work - the share may not be mapped.
> > Same for WNetOpenEnum, WNetEnumResource .

> > I know the data is in registry under (W9x - not sure under NT, W2K & XP)

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Network\LanMan

- Show quoted text -

Quote:
> > but registry browsing doesn't seem like a smart way to do this.

> > Can anyone point me to information about how to accomplish this?

> > Thanks,

> > --
> > Dale Sampson
> > http://www.dalesplace.net/download/



Tue, 13 Jul 2004 18:13:09 GMT  
 
 [ 7 post ] 

 Relevant Pages 

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

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

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

4. What is network share name of local drive

5. Retreiving The Shared Directory Name On A Local Drive

6. getting share name of a local drive

7. getting share name of a local drive

8. getting share name of local drive

9. Help Obtaining Local Drive UNC or Share Name

10. <<<<<<<<ComboBox>>>>>>>>>>>>

11. SUBST local directory to drive letter

12. Get Local Drive Letters ?

 

 
Powered by phpBB® Forum Software