procedure TForm1.Button1Click(Sender: TObject); var w: dword; Root: string; i: integer; begin w := GetLogicalDrives; Root := '#:'; for i := 0 to 25 do begin Root[1] := Char(Ord('A') + i); if (W and (1 shl i)) > 0 then if GetDriveType(Pchar(Root)) = DRIVE_CDROM then Form1.Label1.Caption := Root; end; end;