Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have txt files in multiple folders: (folder_1, folder_2 . . . folder_n).

I would like to copy all these files into another directory using the Windows command line.

How can I accomplish this?

share|improve this question
    
How would you like conflicting filenames to be handled? Ignored (skipped)? Overwritten? Abort the copy operation? Could you provide an example (list some sample source file paths and same destination file paths)? –  Bob Jun 20 '12 at 8:32
2  
Would the answers to this question help? They handle conflicting filenames. –  Bob Jun 20 '12 at 8:32
2  

2 Answers 2

you can try it using a batch file
place all the copy commands that you need into the batch file, for example

copy <path1>\file*.txt <destination> 
copy <path2>\file*.txt <destination>

and so on as many times as you need. Then run the batch file
Create the batch file in notepad and save with the .bat extension

share|improve this answer

Copying multiple files

  1. Using the cd command, move to the directory that contains the files you wish to copy.

  2. Once in the directory that contains the files you wish to copy, type a command similar to one of the below commands.

copy . c:\mydir

In the above example, the command would copy every file in the current directory to the "mydir" directory.

copy *.txt c:\mydir

In the above example, the command would copy every txt, or text file, in the current directory into the "mydir" directory.

share|improve this answer
    
The question is asking about copying files from multiple folders. Unless you are recommending manually changing to each directory before copying, this does not answer the question. And the question implies a large number of directories where manual switching is far from optional. –  Bob Jun 23 '12 at 8:27
    
I apologize if I am wrong answer just to answer what I understand –  Chuzein Part II Jun 23 '12 at 8:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.