***************************************************************** * Neveprise Inc. Delphi FAQ * ***************************************************************** * Section: Files Topic: Enumerate drives * * Created: July 27th, 1999 Revised: July 27th, 1999 * * Updates: www.neveprise.de Info: support@neveprise.de * ***************************************************************** Q: How can I get a list of all installed drives? A: To get a list of all drives in a system, we just need to have to call the WinAPI function GetLogicalDrives(). It retrieves a "list" of all drives and we only need to have to check all elements if they are correct. We do a loop of 25 passes, that is the maximum number of drives available (a-z). procedure GetDrivesH(Drives: TStrings); var DI: DWord; i: integer; begin DI:=GetLogicalDrives; Drives.BeginUpdate; for i:=0 to 25 do begin if (DI and (1 shl i))<>0 then Drives.Add(Char(Ord('A')+i)+':\'); end; Drives.EndUpdate; end; Drives is the Result of type TStrings. Note that you should use TStringList for internal purposes. The function declared here can just feed components like TComboBox or TListBox. Blazko