Run TUFLOW From a Batch-file: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 148:
===Looping in a batch file up to a certain number of runs===
See also this post by user Ben G T on the
[http://www.tuflow.com/forum//index.php?showtopic=1005&view=findpost&p=2997 TUFLOW forums].<br>
As a brief description of the below, the "do_while_loop_start" counts the number of processes in the task manager which have "TUFLOW" in the name. If this is greater than or equal to the variable "CPU_Cores" then then batch file waits for 60 seconds.
<pre>
@ echo off
Set A=Q001 Q002 Q005 Q010 Q020 Q050 Q100
Set B=Exg Dev
set /a CPU_Cores=3
FOR %%a in (%A%) DO (
FOR %%b in (%B%) DO (
call :do_while_loop_start
Start "TUFLOW" "C:\TUFLOW\Releases\2012-05\w64\TUFLOW_iDP_w64.exe" -b -e1 %%a -s1 %%b M11_5m_~e1~_~s1~_001.tcf
)
)
Pause
:do_while_loop_start
set /a count=0
for /f %%x in ('tasklist ^| find /c "TUFLOW"') do set count=%%x
if %count% geq %CPU_Cores% (
PING 1.1.1.1 -n 1 -w 60000 >NUL
goto do_while_loop_start
)
</pre>
| |||