Solved

%CD-ROM% = %SystemRoot% for the CD Rom drive?

Posted on 2008-10-03
3
834 Views
Last Modified: 2008-10-06
%SystemRoot%
of course, is the designation for the C:\WINDOWS\ or the C:\WINNT\ directory, depending on our PC

how do i declare the CD-ROM drive?   %CD-ROM% ?
and what if there are more than one CD-ROM drive?
0
Comment
Question by:MacRena
  • 2
3 Comments
 
LVL 2

Expert Comment

by:UnicornBoy
ID: 22636866
the variables between percentage signs are called "Environment Variables"...
some of them are hidden like the one you mentioned: %SystemRoot%

all of the defined Environment Variables could seen in this place:
for XP: control panel / system (properties) / advanced tab / Environment Variables (button on the bottom!)

some of them are defined by default when you install windows, others are defined by installing programs.

BUT

there is no variable that would represent the CD-Rom drive path...

I don't know want purpose you have for looking for such environment variable, but there are lots of solutions for any kind of operation you may want to perform...

tell me what you want to do with for example %CD-ROM%, then I'll tell you exactly what's the solution...
0
 
LVL 4

Author Comment

by:MacRena
ID: 22636898
my customer wants to reference a file in a folder off the root of the CD drive, in a VB program that's running from the C:\ drive.
0
 
LVL 2

Accepted Solution

by:
UnicornBoy earned 50 total points
ID: 22636991
if he is programming in Visual Basic he/she easily could get all removable drives and paths using windows APIs...

there is a example I found on internet:  http://www.mvps.org/access/api/api0003.htm

for testing it, open an empty VB6 project, copy&paste code
call the sub "sListAllDrives" in form_onLoad...

it will print debugs like this:

    Local drive :  C:\
Removable drive :  D:\
Removable drive :  E:\
Removable drive :  H:\


analyze the code and extract what you want...
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

829 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