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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
JayMel
Posts: 1
Joined: 07 Dec 2018 11:03

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

#1 Post by JayMel » 07 Dec 2018 11:10

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.

aGerman
Expert
Posts: 3625
Joined: 22 Jan 2010 18:01
Location: Germany

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

#2 Post by aGerman » 08 Dec 2018 10:59

Code: Select all

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

Steffen

Post Reply