DL:= TDrivesList.Create;
if DL.Count > 0 then
 for Ind:= 0 to DL.Count - 1 do
  if (DL.Items[Ind].DriveType = dtOptical) and (DL.Items[Ind].DriveLabel[1] = ADisc) then
   EjectDrive(DL.Items[Ind]);
FreeAndNil(DL);
