Command Prompt question
Hi all, learning the command prompt on windows for the first time. While studying I came across the "copy" command and I have been trying to copy two files at one time to a different folder. The command syntax I've been using is: copy file1+file2+file3 destination. What ends up happening is the files (when I've done it they were .txt files) "merged" together. I list tge three seperate files and they copy over as one file. When I open that file, the text of all 3 files are there.
Is there a way to copy more than one file to a different destination using one input? I know wildcards, but I'm talking files of different types.
Thanks to any and all help in advance!
Is there a way to copy more than one file to a different destination using one input? I know wildcards, but I'm talking files of different types.
Thanks to any and all help in advance!
Comments
-
TechGuru80 Member Posts: 1,539 ■■■■■■□□□□
-
Phalanx Member Posts: 331 ■■■□□□□□□□An easier way than doing a loop is to use the ampersand.
eg. copy file1 & copy file2Client & Security: Microsoft 365 Modern Desktop Administrator Associate | MCSE: Mobility
Server & Networking: MCSA: Windows Server 2016 | MTA: Networking Fundamentals
Data Privacy & Project/Service Management: PECB GDPR DPO/Practitioner | ITIL 2011: Foundation | CompTIA Project+
Currently Studying: Microsoft 365 Enterprise Administrator Expert -
TheFORCE Member Posts: 2,297 ■■■■■■■■□□Hi all, learning the command prompt on windows for the first time. While studying I came across the "copy" command and I have been trying to copy two files at one time to a different folder. The command syntax I've been using is: copy file1+file2+file3 destination. What ends up happening is the files (when I've done it they were .txt files) "merged" together. I list tge three seperate files and they copy over as one file. When I open that file, the text of all 3 files are there.
Is there a way to copy more than one file to a different destination using one input? I know wildcards, but I'm talking files of different types.
Thanks to any and all help in advance!
Use the other two commands, xcopy and robocopy, they have more advanced features. Also, if you type <command name> /? It will give you more information on how the command is used.