Got a folder which contains automatically generated batch scripts. For example - a cron job runs a script, grabs all new rows from a database, cURLs to my windows server, writes a batch file to the folder with the specific ID.
I then have a secondary batch file which I need to run all these batch files at once, not sequentially. The reason for this is at any one time, there can be 100 batch scripts in the folder, taking on average 3 minutes each, which is five hours, while testing shows that all 100 are fine running at once, and only takes 5 minutes.
So far I have:
FORFILES /S /P "./batch_files" /M *.bat /C "cmd /c call @file /Q "
Which does loop through all the files, however only runs them sequentially. I was thinking assigning each file name to a variable and using the "&" operator so it would basically be
FORFILES /S /P "./batch_files" /M *.bat /C "cmd /c variable = variable+"&"+@fname /Q "
call variable
But in proper batch file formatting (I suck at CMD).
Also I don't know whether "variable" would be global, as it runs a separate instance of cmd on every forfiles?