What is the environment variable for the CDROM. I am
needing to link data to info on a CD and that drive
letter changes from machine to machine.
There is no environmental variable to indicate the drive letter
for your CD ROM. You could use Google to locate a tool
that tells you if a given drive letter relates to a hard disk,
a CD drive or a networked drive. Alternatively you could
use the batch file below. It will identify the highest registered
drive letter - very often this is the drive letter for the CD ROM.
Reg.exe comes with the WinNT Resource Kit, and can
probably be downloaded freely from some Microsoft site.
@echo off
for /F "tokens=2" %%a in ('reg query hklm\system\mounteddevices ^| find /i
"DosDevices" ^| sort') do set x=%%a
for /F "tokens=2 delims=\" %%a in ('echo %x%') do set CDDrive=%%a
echo The CD is probably on drive %CDDrive%.