Jump to content

Recommended Posts

Posted

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


Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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