Copying Multple file formats in dos to new directory

NAIDANAC A

Well-Known Member
Joined
May 30, 2006
Messages
4,440
Location
Ontario, Canada
Car(s)
300E
Does anyone know how to copy multiple file formats in dos (eg. .json and .gif) to a new directory without changing the file types? I have googled for to no advail. (It is a project I have to do...).
 
Do you want to copy the whole directory or just particular files ?

Code:
> copy *.* [I]destination[/I]

Also, do you want to copy all the files of the given type or just certain ones ?

Code:
> copy *.ext [I]destination[/I]

Notes:
destination is the destination directory or device
* is the wildcard character.
*.* copies all files in the given subdirectory
*.ext copies all files with extension of 'ext'

Or you can read up on the copy command, or use the xcopy command instead.
 
Last edited:
I need to copy 2 types of files in one statement. So I will need to copy a file that has .gif, and one that has .json.
I have other files in the directory but those are already copied (like I said assignment) and I cannot just copy them again. I have tried COPY *.gif + *.json BACKUP. That reads both .gif and .json files but only copies .gif...I really hate when profs make you do things that you can do easier by touching 1 button.
 
I need to copy 2 types of files in one statement. So I will need to copy a file that has .gif, and one that has .json.
I have other files in the directory but those are already copied (like I said assignment) and I cannot just copy them again. I have tried COPY *.gif + *.json BACKUP. That reads both .gif and .json files but only copies .gif...I really hate when profs make you do things that you can do easier by touching 1 button.

It actually will combine the two files into one, unfortunately. I can't really figure out how you're supposed to do this, other than to run two copy commands with each file type.

The best I can figure it is like this:

Code:
copy a.gif BACKUP && copy b.json BACKUP

which basically runs the copy command twice, back to back.

(The && allows you to run another command after the first).

But I guess this isn't really what your prof is asking for, now, is it ?

Sorry I can't be of much more help than this, though.
 
No that is perfect, I do not know if that is what he means, but it is one comand line. I was trying to figure out how to use the & to do multiple and never thought it would be like java. Thanks a ton.
 
Top