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.
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
Underground A Human History of the Worlds Beneath our Feet
by Will Hunt
Cry the Beloved Country
by Alan Paton
The Turn of the Screw
by Henry James
Beowulf
by Anonymous Anglo-Saxon poet
Fahrenheit 451
by Ray Bradbury
Dandelion Wine
by Ray Bradbury
One Flew Over the Cuckoos Nest
by Ken Kesey
The Remains Of The Day
by Kazuo Ishiguro
East of Eden
by John Steinback