Run TUFLOW From a Batch-file: Difference between revisions

Content deleted Content added
Line 71:
This section is yet to be finalised.
===Creating a delay===
====Windows 7====
For a Windows 7 operating system a delay of a set duration can be created with the Timeout <seconds> command. For example:<br>
<pre>Timeout 10</pre>
Will create a 10 second delay, a countdown timer is given. Press any key to continue.
 
====Other Systems====
It is possible to create a delay of specified length in a batch file. The best way do this is actually to create a second batch file! To do this create a text file and call it '''wait.bat'''. Within that file enter the following text:
<pre>@ping 127.0.0.1 -n 2 -w 1000 > nul
Line 82 ⟶ 88:
For this to work the wait.bat file needs to be in the same folder as the batchfile calling it. You can put the file in a specific location and add this path as an environment variable. If this is done "call wait <time in seconds> can be added to any batch file.<br>
To set the environment variable, you will need to have administrator access to the machine, and add a colon (;) and then the batchfile location (e.g. ";C:\batch_files\" , without the quotes) in the '''path''' system variables. The separator character is a colon (;) this is added to specify a new path. For more details on modifying the environment please see here: [http://support.microsoft.com/kb/310519 http://support.microsoft.com/kb/310519].
 
===Variables===
Batch files can be easily setup so that they are more generic and easily customised when moving from one project to another. For example, in the below a variable, TUFLOWEXE, is used to define the path to the TUFLOW exe to be used, and a variable RUN is used to incorporate options such as the /wait so that the simulations run in series (one after the other).