Skip to content

Instantly share code, notes, and snippets.

@craigvantonder
Last active March 27, 2022 10:39
Show Gist options
  • Save craigvantonder/5d9ee6eb0d2267b28271da3908abc10d to your computer and use it in GitHub Desktop.
Save craigvantonder/5d9ee6eb0d2267b28271da3908abc10d to your computer and use it in GitHub Desktop.
Windows batch file to recursively copy all files of a specific type to an output directory
@echo off
setlocal
set DIR=C:\path\from
set OUTPUTDIR=C:\path\to
for /R %DIR% %%G in (*.jpg *.jpeg) do copy "%%G" "%OUTPUTDIR%"
@MoatazAbdAlmageed
Copy link

I need to copy each file in each folder :)

like if I found file called cat.jpg in animals folder I want to create animal folder in OUTPUTDIR and add cat.jpg into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment