Search the Community
Showing results for tags 'computer managment'.
Found 1 result
Using batch files it is possible to shutdown your computer at the end of the a series of TUFLOW simulations. There are a number of ways of doing this. If you have only a single batchfile running you can add the following at the end of your batch file: shutdown.exe /s /t 30 This will shutdown the computer (/s for shutdown, /r for restart) with 30 seconds warning (/t 30). For example, the batch file below, uses the event / scenario features in TUFLOW to run 5 design event magnitudes, for 5 durations and 3 topography configurations (75 total simulations) and at the end of this the computer will shutdown: set A=Q010 Q020 Q050 Q100 Q200 set B=10min 30min 60min 120min 270min set C=Exg Dev Mit FOR %%a in (%A%) do ( FOR %%b in (%B%) do ( FOR %%c in (%C%) do ( start "TUFLOW" /wait TUFLOW_iSP_w64.exe -e1 %%a -e2 %%b -s1 %%c filename_~e1~_~e2~_~s1~.tcf ) ) ) shutdown.exe /s /t 30 Another option if a shared modelling resource (which may be running multiple batch files) is to monitor the number of "TUFLOW" processing in the task manager and when this is zero to shutdown the computer. The following batch file does exactly that! echo off :do_while_loop_start set /a count=0 for /f %%x in ('tasklist ^| find /c "TUFLOW"') do set count=%%x IF %count%==0 ( shutdown.exe /s /t 30 ) ELSE ( timeout 60 goto do_while_loop_start ) pause This batch file counts the number of processes with "TUFLOW" in the process name and if this is greater than 0, a delay of 60 seconds is created and the loop started again. If no "TUFLOW" simulations are running a shutdown command is issued. Note, that this only takes into account the number of TUFLOW simulations, so be careful if of number crunching is done on the machine. To test the batch file, change the "shutdown.exe /s /t 30" to "echo shutdown.exe /s /t 30". This will simply display the line to the console window rather the actually processing the shutdown. See also the batch file page on the TUFLOW wiki: http://wiki.tuflow.com/index.php?title=Run_TUFLOW_From_a_Batch-file#Shutdown_on_Completion Cheers Phil