Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Help - Network Question !
Message
From
21/05/1999 21:41:18
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00221665
Message ID:
00221679
Views:
12
>Hi All:
>
>Does anybody now how to Find the net name for current drive ?
>Ex:
>
>C: = \\PEDRO\C
>

It's not a simple operation; often, the same directory can be referenced by several different shares. ANETRESOURCES() will retrieve the list of available shares for a given machine, but doesn't return the local drive and path. There may be no share for any given folder on a local system, either.

The cleanest way to extract the information is to spin through the registry to find the shares and their associated local paths. The set of registry keys, and the format that the local share information is stored in the registry for a given system is different under Win9x and WinNT. Under Win9x, shares made available through the MS Network Client are found under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Network\LanMan; there's a subkey per share, and the path is stored as a registry value named Path under each. Under NT, the shares are found under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares; each share is a registry value of type REG_MULTI_SZ, with the path as one of the subentries in the REG_MULTI_SZ entry, delimited by CHR(0)+'Path=' in front, and terminated with a trailing CHR(0).

>Thanks in Advance !
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform