Shotgun Posted February 19, 2004 Posted February 19, 2004 I use this to find the CD drive from a batch file:for /f "Tokens=*" %%a in ('getcd.exe') do set cdrom=%%athen 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 colonFor example:copydir.bat@echo offfor /f "Tokens=*" %%a in ('getcd.exe') do set cdrom=%%acopy %cdrom%\install\wmp9\wmsetup.exe %systemdrive%\tempgetcd.exe can be downloaded here
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now