Solved

Find the CD Drive Letter

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now