Loop through all sub folder of and execute bat File?

batch-file, call, directory, loops

Solution

@echo off
for /r /d %%f in (*) do pushd "%%f" & Call "callshow.bat" & popd

Problem

I am trying to have a bat file in a parent directory that loops through the sub folders and runs a bat file named `callshow.bat`. Here is what I've got so far. I'm not very good at these so any help would be great! ``` for /r %%f in (*) do Call callshow.bat ``` Here is the folder Structure: ``` Example: Parent:(Where new Bat file will be) Sub Folder 1\folder1\callshow.bat Sub Folder 2\folder2\callshow.bat Sub Folder 3\folder3\callshow.bat Sub Folder 4\folder4\callshow.bat Sub Folder 5\folder5\callshow.bat etc....... ```

Original source