Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi All ,Is there any way I can use %XXX% (xxx refers to CDROM) to map what ever CDROM drive is there on any machine . for example I can locate the root of Windows using %systemroot% from DOS or run command .
The reason is CD ROM drive letter vary from PC to another ,I want to have it as a variable to be able to run my application on any PC.
Thanks in advance.
Presage

Hi All ,
Is there any way I can use %XXX% (xxx refers to CDROM) to map what ever CDROM drive is there on any machine . for example I can locate the root of Windows using %systemroot% from DOS or run command ,I want to do the same for the CD drive.The reason is CD ROM drive letter vary from PC to another ,I want to have it as a variable to be able to run my application on any PC.
Thanks in advance
Presage

You're talking about finding which drive letter is the CD-ROM drive? Or, more precisely, which drive (could be CD-RW, DVD-ROM, etc.) is holding your disc?
I can't find any DOS commands to do it, but maybe there's something in the system API to do it. A none-too-quick and extremely dirty way to find which drive is a CD-ROM might be to (starting at D: and going up through Z:) do a DIR on each device letter and capture the output. Look for file(s) or label(s) that you know are unique to your CD. I don't think the Volume Serial Number will be of any use, since it seems to be XXXX-XXXX for anything but the C: drive. The VOL command can be used instead, if you only want to look at the label and serial number. Good luck, and let us know if you find a cleaner way!

There is a real good resource at
http://www.robvanderwoude.com/amb_c...Download the source (button at bottom of page) and unzip. I found that CDROM3.bat worked for OS versions up to W2K and CDROMXP.bat worked for WinXP. Don't know about Vista but I'm sure it can be tweaked because one batch file looks at a registry entry and another uses DISKPART.exe. One of these should work for Vista.
Time for a coffee break...

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |