Page 1 of 1

Complicated batch file... at least for me. Help Needed

Posted: 07 Dec 2018 11:10
by JayMel
Without going into to much detail I have one set "known" root folder but the sub folders names will constantly be changing. I need to find away to run a batch file from root directory, scan every folder/subfolders for folders named "reports", and then copy the contents of all of the reports folders to the root directory for export. I have been able to "dir reports /s" and see all the folders out there, but I can't figure out a universal batch file that doesn't care about path to pull the contents of these folders from the sub directory's. Any help anyone may be able to provide would be helpful! Thanks in advance.

Re: Complicated batch file... at least for me. Help Needed

Posted: 08 Dec 2018 10:59
by aGerman

Code: Select all

for /f "delims=" %%i in ('dir /ad /b /s "reports"') do copy "%%i\*.*" ".\"
Just a guess though.

Steffen