I want to copy all images on my computer to a single folder

I want to copy all images of any file extension like .jpg, .png, .gif, etc. from all folders and subfolders in my PC hard drive (which has two partitions) to a single folder.

The total number of images I have is 250,000.


The easiest way is probably to make a batch file, which searches recursively for a specific file type and copy all instances of it to a folder of your choice. This script should do the job for one partition at a time:

for /R "C:\" %%G in (*.png *.jpg *.jpeg *.gif) do copy "%%G" "E:\allPictures\"
pause

Be aware, that I would strongly advise you to add an external hard drive and point the output to a folder on it. You don't want the batch script copying from it's own output folder.

E:\allPictures\ is the output, which is what you need to change.

Save it as "something.bat" and execute.

Explanation

The script starts searching from the directory you give it. In my example I've chosen C:\ per your request.

The /R tells it to start looking thru every single folder below the chosen folder aka recursively, for the given file types: (*.png *.jpg *.jpeg *.gif)

%%G is a placeholder/container for the full path to a file. So if the file it just found fits the requested file type, it will supply it to the copy command.

At the end you have the path to your output folder. E:\allPictures\

The pause at the end, is so you know when it's done.

Hope that answers your question.

Good luck!


In Windows Explorer, search for:

*.png OR *.gif OR *.jpg OR *.jpeg*

Select all files, and copy them to wherever you want


You can use something simple like xcopy

 xcopy c:\*.jpg e:\ /s

This will copy all the JPG files in C: drive to the root of E: and create the folders as XCOPY finds them in on the C: drive.

You just have to do this repeatedly for the different files types such as gif, png, tiff, or whatever other file format you want to consolidate.