>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 !