Saturday, May 6, 2017

windows - how to run a batch recursively

I have a parent folder (BIG_Folder), which contains many subfoldes (folder1, folder2, folder3 ...) in each subfolder a batch file exists, it is always the same (x.bat).



I want to run all bats, recursively from another bat.




BIG_Folder ( folder1 (x.bat), folder2(x.bat), folder3(x.bat) )



The folder1, folder2, folder3 are not created, created by a previous bat.
For that reason, I seek to do recursively to all subfolders contained in BIG_Folder.



Attached code as I copy the bats to folders.



for /D %%f in ("C:BIG_Folder\*") do copy "C:\3.bat" "%%f\" 



Any help is appreciated

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...