Productivity Tip: Copy Files From Subfolders to One Folder
So, you want to become more productive? How about learning how to copy files from subfolders to one specific folder. This could possibly be a huge time-saver! Let’s get to it.

Windows 7 provides several great tools that allow you to copy files more effectively. Unfortunately, most of them are only accessible via the command prompt. There are for example: copy, xcopy and robocopy. All three can be used to become more productive.
1. Open a command prompt
2. Enter cd C:\pathtoyourfolder **replace pathtoyourfolder with your actual path, e.g. C:\Users\username\Pictures
3. Copy files from subfolders to one folder:
for /f “tokens=*” %a in (‘dir /b /s /a-d’) do @copy “%a” “C:\YourFolder” /y
What is does is to look into each subfolder (dir /b /s /a-d) in the current folder and then copy each file in the subfolder. It will copy each file to the folder C:\YourFolder
What is the /y doing? I am using this option to NOT get prompted for overwriting files. If you don’t add /y it will always ask if you want to overwrite files with the same name. So, if you have files in the subfolders with the same name you will have to rename them first.
If you’ve done everything correctly, it will then copy all files within the subfolders and copy them to the folder that you specified:

Next up, are some more productivity tips, so stay tuned for more!
Or you might like these sexy wallpaper, tweaks and themes:
Tags: productivity Written by oliversk Wednesday, September 15th, 2010
Was it helpful? Please bookmark it and spread the word









This does not work keep getting error *” was unexpected at this time.
code was
for /f “tokens=*” %a in (‘dir /b /s/a-d’) do @copy “%a” “d:\new\rar” /y
I have got this working. with the following
for /f “tokens=*” %a in (‘dir /b /s /a-d “c:\test”‘) do @copy “%a” “d:\new\rar”
It appears you left out the source folder (c:\test) in your example.