Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 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

21 Experts available now in Live!

Get 1:1 Help Now