I want my files to be copied in one folder, the files came from different folder but in the same location.
I run this code in CMD but it copies the folder into new directory.
xcopy "D:\NBS Contents\Latest Images\*.jpg" "D:\output" /s
The latest images folder has many folders containing images files. I want to combine them into one folder.
Best Answer
So in
cmd
you'll to have to do the below stepsStep by step explaination:
D:
- switches to D: drivemkdir output
- Creates output directorycd "D:\NBS Contents\Latest Images\"
- Changes current directory to the one in quotesfor /r %f in ( "*.jpg" ) do copy /y "%f" "D:\output"
- Recursively, for every jpg file, copy the source file tod:\output
. The/y
switch suppressesAre you sure you want to overwrite
prompt, you can remove the switch if you want the prompt.