Solved

Find the CD Drive Letter

Posted on 1998-05-04
5
387 Views
Last Modified: 2008-02-01
 Is there a function that I can call to find out the drive letter of the CD-ROM.  I to distribute an application on CD-ROM, but I don't want people to be able to copy the CD-ROM to the hard drive and pass the CD-ROM to someone else.
  Therefore I want to make the program read the data off of the CD-ROM and only the CD requiring them to have the CD in to run the application.
0
Comment
Question by:Jagar
[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
  • 2
  • 2
5 Comments
 

Accepted Solution

by:
MikeABB earned 50 total points
ID: 1439012
You can create a drive list and cycle through the drive letters and use the API call GetDriveType to check if it is a CD-ROM.  Here is the information:


Declare Function GetDriveType& Lib "kernel32" Alias "GetDriveTypeA" (ByVal _
nDrive As String)

Parameter      Type/Description
nDrive      String— A string containing the path to the root directory of the drive.

Return Value
Long—Zero if the drive cannot be identified. One if the specified directory does not exist. One of the constants DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM or DRIVE_RAMDISK specifying the drive type on success.
0
 
LVL 4

Expert Comment

by:zsi
ID: 1439013
jagar,

In addition to MikeAbb's (any relation to ClifABB?) comments, you might also want to consider either usint the same label on the CD and testing for the existence of that label, or bury a file somewhere in your directory structure and look for it.  This will help to ensure that the proper CD is in the drive.

Don't knock yourself out too much in your attempt to provide copy protection.  You can get a CD burner now for less than $300. :)

If you are really serious about copy protection, I suggest you take a look at Rainbow Technologies (http://www.rainbow.com).  They offer professional anti-piracy solutions.

zsi
0
 
LVL 2

Author Comment

by:Jagar
ID: 1439014
Thanks for the above suggestions, I just trying to make a little protection, so the CD's required will be OK.
0
 

Expert Comment

by:MikeABB
ID: 1439015
zsi,
we work in the same group
0
 
LVL 2

Author Comment

by:Jagar
ID: 1439016
Thank you for your help
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month3 days, 17 hours left to enroll

630 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