This is a little clunky, but it works:
function FindDrive(UNCName : string) : string;
var
Drv, res : array[0..100] of char;
c : char;
i : dword;
begin
strpcopy(Drv,'a:');
Result := '';
for c := 'c' to 'z' do
begin
i := sizeof(res);
Drv[0] := c;
i := WNetGetConnection(Drv,res,i);
if (i = 0) and (stricomp(res,pchar(UNCName)) = 0) then
Result := StrPas(Drv);
end;
end;
-medge
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"