Solved

Find the CD Drive Letter

Posted on 1998-05-04
5
381 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
zsi,
we work in the same group
0
 
LVL 2

Author Comment

by:Jagar
Comment Utility
Thank you for your help
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

762 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

9 Experts available now in Live!

Get 1:1 Help Now