Share via

Copy Multiple Files from Subfolders to Single Folder

Anonymous
2010-02-23T04:14:38+00:00

Hi everyone, I am looking for a way that I can copy all my jpg files from SubFolders into a Single Folder, without having to actually go into each SubFolder and perform a Drag and Drop.

Each Subfolder is in the same Directory Tree (for example):

d:\Work Files\Colors\Finished\1

...

d:\Work Files\Colors\Finished\1200

In each SubFolder there are three jpg's that I want to copy.  I want all the jpg's in every subfolder to go to a single folder:

d:\Completed Color Files

I've been trying to use the for /r %d in (.) do copy %d*.jpg d:\Completed Color Files

The copy command fails because the %d (Current Path) has a . at the end of it.  Can anyone help me here, I really don't want to have to do all these by drag and drop.

Bob

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2010-02-23T06:00:17+00:00

    This should do it, assuming that you want to copy the entire contents of each subfolder (i.e. the subfolders contain only the three jpgs):

       cd /d "d:\work files\colors\finished"

       for /r %d in (*) do copy "%d" "d:\Completed Color Files"


    Boulder Computer Maven

    Microsoft Most Valuable Professional

    10+ people found this answer helpful.
    0 comments No comments

17 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-02-15T20:00:58+00:00

    for /r %d in (*.jpg) do copy "%d" "d:\Completed Color Files"

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-06-01T13:50:06+00:00

    This works, but it is so 1990's.  This works just as good a GUI format

    1 - Go to the common parent of all your pictures.  D:\Work Files\Colors\Finished\ .

    2 - Type an asterisk into the Search box at the top-right. All files and folders under your current position will be listed.

    3 - Sort by name, which will group all the folders together, and then all the files together as well (in a flat view, regardless of what folder they are really in).

    4 - Select all the files, press "ctrl" and drag them into the folder  you really want them to be stored in D:\Completed Color Files.    

    1.  Do not press the "ctrl" key while dragging the files if you want to move them, not copy them.

    Have fun.

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2015-04-06T06:19:45+00:00

    Hi everyone, I am looking for a way that I can copy all my jpg files from SubFolders into a Single Folder, without having to actually go into each SubFolder and perform a Drag and Drop.

    Each Subfolder is in the same Directory Tree (for example):

    d:\Work Files\Colors\Finished\1

    ...

    d:\Work Files\Colors\Finished\1200

    In each SubFolder there are three jpg's that I want to copy.  I want all the jpg's in every subfolder to go to a single folder:

    d:\Completed Color Files

    I've been trying to use the for /r %d in (.) do copy %d*.jpg d:\Completed Color Files

    The copy command fails because the %d (Current Path) has a . at the end of it.  Can anyone help me here, I really don't want to have to do all these by drag and drop.

    Bob

    Hi..

    step:1 Go through your Directory for (i.e. the sub folders contain only the three JPEGs)

    Setp:2   search the mentioned extension(i.e).jpg

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2010-02-23T22:08:32+00:00

    Thanks Steve, that works for what I needed to have happen.

    Bob

    1 person found this answer helpful.
    0 comments No comments