Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CD ROM Drive Detection

Posted on 1998-04-07
1
Medium Priority
?
352 Views
Last Modified: 2012-05-04
How do I detect a users CD ROM drive ?
0
Comment
Question by:jcoulter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 150 total points
ID: 1361330
Hi

The following function will return the CDRom Drive string (e.g. E:\) for the first CDROM on the system.  An empty string means that the system doesn't have a CDROM installed.

function GetCDRomPath: string;
var
  i: Integer;
  Drives: DWORD;
begin
  Result := '';
  Drives := GetLogicalDrives;
  for i := 0 to 25 do
    if ((Drives and (1 shl i)) > 0) and (GetDriveType(PChar(Chr(65 + i) + ':\')) = DRIVE_CDROM) then
      begin
        Result := Chr(65 + i) + ':\';
        Break;
      end;
end;


Regards,
JB
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question