B
B
bulochkinvalya2019-12-04 15:57:09
cmd/bat
bulochkinvalya, 2019-12-04 15:57:09

How to copy files with a specific extension?

Hello. There was a need from 157 folders to pull out the pictures and put them in one. All in jpg format.
The easiest way is either the command line or a bat file.
I don’t understand this myself, but I found two commands, one is COPY, which copies in the current directory, the second is XCOPY, which does with saving directories.
Tell me, please, how to force the COPY command to check all nested directories, or the XCOPY command to throw everything into one single directory
UPD
On one forum I found a solution to a similar problem. but the description of the person is completely incomprehensible. what does he mean?
5de7ad187c1c8451329742.png
xcopy C:\users\job_o\Desktop\test\*.jpg C:\users\job_o\Desktop\test2\ /H /Y /C /R /S
copy C:\users\job_o\Desktop\test\*. jpg C:\users\job_o\Desktop\test2\
Found a solution, through a batch file.
@FOR /R %%i IN (*.*) DO ( CD %%~pi
copy *.jp*g C:\users\job_o\Desktop\test2 )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ronald McDonald, 2019-12-04
@bulochkinvalya

The easiest way is either the command line or a bat file.

No, the easiest way is to use "*.jp*g" in the Explorer search bar. Try it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question