Copying files with batch file from CD-ROM drive

Citadel535

Senior member
Jan 16, 2001
816
0
0
Can anyone help me out?
For some reason this batch file gets a file not found *.* error when trying to run it from a cd drive.
--
mkdir c:\meddemo
c:
cd \meddemo
xcopy %1:\medimage\*.* \meddemo /s/e
cd \
--

Does anyone know why since I can't get it to run from the cd and install on the drive? Does anyone know what %1 means in the batch file?

Please help me out!
 

Topochicho

Senior member
Mar 31, 2000
338
0
0
My guess is that you need to pass the cdrom drive letter as an argument to the batch file.

batch.bat I

with being your drive letter. Just the letter, not I: or I:\.

stolen from the win2000 help file:

% (Replaceable parameter)
The replaceable parameters %0 and %1 to %9 can be placed anywhere within a batch file. When the batch file is run, %0 is replaced by the name of the batch file, and the argument variables %1 to %9 are replaced by the corresponding parameters entered on the command line.

For example, to copy the contents of one folder to another, you would add the following statement in your batch file:

xcopy %1\*.* %2

When you run the file, you would type the following:

mybatch.bat C:\afolder D:\bfolder.

The effect is the same as if you had written xcopy C:\afolder \*.* D:\bfolder in the batch file.

The % parameter expands the batch script argument variables (%0, %1, ..., %9) as follows: