Shotgun Posted February 19, 2004 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now