Jump to content

Another method to find the first CDROM drive


Recommended Posts

I use this to find the CD drive from a batch file:

for /f "Tokens=*" %%a in ('getcd.exe') do set cdrom=%%a

then use the cdrom variable to refer to the CD drive (cdrom=F: , my 1st cd drive)

Notice the cdrom variable does not have a backslash, only the ending colon

For example:

copydir.bat

@echo off
for /f "Tokens=*" %%a in ('getcd.exe') do set cdrom=%%a
copy %cdrom%\install\wmp9\wmsetup.exe %systemdrive%\temp

getcd.exe can be downloaded here

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...