This almost works, you need to loose the '\' in drive designation: e.g.
IF WNetGetConnection('Z:',@cBuffer,511) = 0
>>I have a win98 network
>>
>>I can I return the server name only by the letter
>>eg.
>> suppose i dont know the servers name.
>>
>>
>> c:\ returns \\computer1
>> d:\ returns \\computer2
>> e:\ returns \\computer3
>>
>> etc.
>>
>>I need to store that to a variable
>>
>
>If you have the Windows Scripting Host installed (which if everyone is running Win98, you do, you can get the information from the Wscript.Network object, which can return a collection of mapped drives and the UNC that they're mapped to via the EnumNetworkDrives method.
>
>You can also use the Win32 API to retrieve the UNC from a mapped drive using the WNetGetConnection() API call, something like:
>
>
DECLARE INTEGER WNetGetConnection IN Win32API ;
> String @cLocalDrive, ;
> String @UNCBuffer, ;
> Integer @Buffersize
>cBuffer = space(511)
>IF WNetGetConnection('Z:\',@cBuffer,511) = 0
> RETURN LEFT(cBuffer, RAT('\',cBuffer) - 1)
>ELSE
> RETURN NULL
>ENDIF
>
>If you wanted the UNC, use AT(chr(0),cBuffer) rather than RAT('\',cBuffer)
>
>>