Copy all .jpg from subfolders to a single folder by cmd

2

I have a folder that has 148 folders in it, and in each of these folders they have a .jpg file. I need to get all these .jpg and put it in a single folder

IcandothisinLinuxso

'#!/bin/bashforarquivoin'findOrigem-name*.jpg';domv"$arquivo" Destino;
    done;

but I can not reproduce this in Windows . Only the find command that I can reproduce the same result: dir /S /B *.jpg

    
asked by anonymous 30.03.2018 / 02:08

2 answers

2

I got the solution

for /r %d in (*.jpg) do copy /Y "%d" "C:\Users\IRINEU\Desktop\a\b"

the parameter /r of for it searches the subpets

I declared the variable d so -> %d

(*.jpg) 

this parameter searches for all .jpg

    
30.03.2018 / 04:22
-1

Create a .bat file for this, and insert the command, it will be somewhat handmade, but only the part of creating the subdirectories listing, for example:

move c:\diretorio1\*.* g:\ /y
move c:\diretorio2\subdiretorio1\*.* g:\ /y
move c:\diretorio2\subdiretorio2\*.* g:\ /y
move c:\diretori3\subdiretorio1\*.* g:\ /y

And then run it.

    
30.03.2018 / 04:04