Description
how can i copy all .jpg files in a directory but not the subfolders? Like even i the .jpg files are in the subfolders put all .jpg files in one folder

Explanation & Answer

This should work:
for /r C:\ %f in (*.jpg) do @copy "%f" D:\pictures\
Explanation:
The command copy "%f" D:\pictures copies the file %f to the location D:\pictures, which is the file pictures in the directory D:\.
Adding a trailing \ to make sure copy treats pictures as a directory.
If you copy multiple files to a single location (e. g., copy *.* D:\backup), copy automatically treats backup as a directory. But this is not the case when you copy a single file.
