quick DOS question

tony4704

Senior member
Jul 29, 2003
336
0
0
What variable do I use for getting the drive letter off the current CDROM the batch program itself is running off of? Thanks.
 
Sep 29, 2004
18,656
68
91
inside of a batch file?

Either way, I can't help, but if it is inside a batch file you need to do this, just use the google.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If you're trying to get to files on that drive from the batch file just use relative paths.
 

tony4704

Senior member
Jul 29, 2003
336
0
0
I'm looking to do a xcopy command that copies files form the CD drive to the computer. However I want this to work across any CD drive letter (D, E, F, etc). What I want to know is if there is some type of environmental variable that says what the current CD drive is. (i.e. something similar to what %homepath% does when it lists the current user). Thanks.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
a 2 second google search for "batch file determine cd drive letter" turned up good results. here is a series of batch files that might contain examples showing you how to solve your problem. this one is supposed to be able to determine which drive letter is assigned to the cd-rom drive. google ftw.
 

jlbenedict

Banned
Jul 10, 2005
3,724
0
0
Look at the contents of the config files on a DOS boot disk (official versions).. either the autoexec.bat or config.sys file's have variables and such that assign the drive letters to the cdrom driver file when it loads.. You may get some ideas from this..
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Why is everyone making such a big deal out of this? Just run 'xcopy \directory\file destination'. Since xcopy is running from the CD all of the paths will be relative to that drive.