Looking to copy all files with extension *.cpp in "development" subfolders to new directory.
For example, C:\source has 10 folders named A1 to A10. Each A folder has subfolder such as development, pending, released. I want to extract all *.cpp from all development subfolders and place in C:\destination.
Example C:\source\A1\development\ folder contains file one.cpp C:\source\A1\released\ folder contains two.cpp
I want only files *.cpp that are in path that contain development name. So in this example only one.cpp should be copied to newfolder
I can name these files from a cmd prompt: dir /s /b *.cpp | findstr /i /m "development" > outfile.txt
(Note that dir command above is searching only filenames, not the contents of the files!)
Guess I could take the outfile.txt and run another batch file
Batch script to copy files listed in text file from a folder and its subfolders to a new location
However, there must be easier way.
BTW:
DOS Batch file to copy certain file types from subdirectories to one folder with rename
does not allow limiting to subfolders.