?
Solved

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

Posted on 2008-10-03
3
Medium Priority
?
837 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
[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
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 200 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Determining the an SCCM package name from the Package ID
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
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…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

752 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