copy command to copy multiple files only copies the first file
-
Tuesday, February 28, 2012 8:06 AM
hi friends
i have a simple question and i'm sorry to ask that here. i didn't get any result after Googling and testing
in win2008 R2 i want to copy 3 files from c:\ to d:\folder2 , but none of the following commands works !! they only copy the first file. what is the cause ?
c:\>copy file1.txt + file2.txt + file3.txt D:\folder2
or
c:\>copy file1.txt+file2.txt+file3.txt D:\folder2
where i am wrong ?
thank in advance
- Edited by john.s2011 Tuesday, February 28, 2012 8:06 AM
All Replies
-
Tuesday, February 28, 2012 8:12 AM
copy file1.txt d:\folder2 & copy file2.txt d:\folder2 & copy file3.txt d:\folder2
Grant Ward, a.k.a. Bigteddy
- Proposed As Answer by OberwaldMicrosoft Community Contributor Tuesday, February 28, 2012 8:31 AM
- Marked As Answer by john.s2011 Tuesday, February 28, 2012 9:12 AM
-
Tuesday, February 28, 2012 8:31 AM
c:\>copy file1.txt + file2.txt + file3.txt D:\folder2
The above command would almost work but it would do something other than what you had intended:
copy file1.txt + file2.txt + file3.txt D:\folder2\Result.txt
It merges the three files and it puts the result into Result.txt. The difference between + and & is this:
+ will cause the files to be merged.
& will cause several commands on one line to be executed one after the other, as if each command was on its own line- Marked As Answer by john.s2011 Tuesday, February 28, 2012 9:12 AM
-
Tuesday, February 28, 2012 9:12 AM
c:\>copy file1.txt + file2.txt + file3.txt D:\folder2
The above command would almost work but it would do something other than what you had intended:
copy file1.txt + file2.txt + file3.txt D:\folder2\Result.txt
It merges the three files and it puts the result into Result.txt. The difference between + and & is this:
+ will cause the files to be merged.
& will cause several commands on one line to be executed one after the other, as if each command was on its own linehi pegasus
thank you very much for your great explanation
regards
-
Tuesday, February 28, 2012 9:13 AM
copy file1.txt d:\folder2 & copy file2.txt d:\folder2 & copy file3.txt d:\folder2
Grant Ward, a.k.a. Bigteddy
hello Bigteddy
thank you very much for great syntax
regards

