Showing the network drive mappings
   


To show a list of all mapped network drives, use the GetNetworkDriveMappings() function. Example usage: GetNetworkDriveMappings(Memo1.Lines);

function GetNetworkDriveMappings(SList: TStrings): integer;
{ Get a list of mapped network drives (if any). }
{ Code adapted from ZieglerSoft [http://www.zieglersoft.dk/uk.html] }

var
  I: Char;
  ThePath: string;
  MaxNetPathLen: DWord;
begin
  SList.Clear;
  MaxNetPathLen := MAX_PATH;
  SetLength(ThePath, MAX_PATH);
  for I := 'A' to 'Z' do
    if WNetGetConnection(PChar('' + I + ':'), PChar(ThePath),
      MaxNetPathLen) = NO_ERROR then
      SList.Add(I + ': ' + ThePath);
  Result := SList.Count;
end;



Blue Orb Software

[email protected]