Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Find Drive letter of CD Drive in Batch file  (Read 3573 times)

0 Members and 1 Guest are viewing this topic.

Brian McGuigan

  • Guest
Find Drive letter of CD Drive in Batch file
« on: October 28, 2004, 05:59:26 PM »
How do I determine the drive letter of the CD drive from within a batch file?

MalikTous

  • Guest
Re: Find Drive letter of CD Drive in Batch file
« Reply #1 on: November 03, 2004, 12:32:57 AM »
Most PCs with Win9x mount the CDROM as the last drive. Put a readable CD in the drive. You can test for content until you get to an error:

set %d=d:
if not exist e:\nul goto finish
set %d=e:
if not exist f:\nul goto finish
set %d=f:
if not exist g:\nul goto finish
. (continues in similar fashion, however many you want to check)
:
:finish
echo CDROM is drive %d