Solved

CD ROM Drive Detection

Posted on 1998-04-07
1
348 Views
Last Modified: 2012-05-04
How do I detect a users CD ROM drive ?
0
Comment
Question by:jcoulter
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 50 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run video youtube webbrowse 10 65
How to debug For loops? 3 57
Dynamically Created Query 3 62
Is there any way to treat Lock record in table with clientdataset? 3 15
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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