Loop through folder tree and execute bat file in subfolders in parallel(accessing the files in the subfolder)

前端 未结 2 1257
死守一世寂寞
死守一世寂寞 2021-01-22 15:54

I am trying to have a bat file in folder1 which is the parent folder, and this bat file which named run.bat will loop through all subfolders, and invok

2条回答
  •  鱼传尺愫
    2021-01-22 16:27

    Based upon your extra information in the comments, this should work for you.

    @echo off
    FOR /d /r %%i IN (*) DO (
       if exist "%%i\child.bat" start "" /d "%%i" "%comspec%" /c "child.bat"
    )
    

提交回复
热议问题