Solved

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

Posted on 2008-10-03
3
835 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

749 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