Solved

Find the CD Drive Letter

Posted on 1998-05-04
5
386 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 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