You can create script files to execute series and combinations of scripting commands to meet specific needs. When working with scripts, keep in mind the following.
IF conditional—The IF conditional expression is a comparison between two values or variables. Use the following syntax for an IF conditional.
IF <relational_expression> THEN <statement_block> [ ELSE <statement_block> ] END
Use the following conditions to create the relational expression.
= | equal to |
!= | not equal to |
< | less than |
<= | less than or equal to |
> | greater than |
>= | greater than or equal to |
statement block | any sequence of valid commands |
FOR Loop—The FOR loop sets a variable to a start value, executes each statement in the statement block, and then adds the step value to the variable. If the new value of the variable does not exceed the end value then the statements will be executed again. This continues until the variable exceeds the end value. If a step value is not provided, the default adds one to the variable. Use the following syntax for the FOR loop.
FOR <variable> = <start_value> TO <end_value> [STEP <step_value>] DO <statement_block> END
WHILE Loop—The WHILE loop evaluates a relational expression and, if it is true, then the statement block is executed. When the statement block has completed execution, the expression will be reevaluated again and, if it is true, the statement block is executed again. This continues until the expression is false. Use the conditions specified in the IF conditional to create the relational expression and the following syntax for the WHILE loop.
WHILE <relational_expression> DO <statement_block> END
When using the Command Line client, a script file can be executed using the -f option. Create a one-line batch file using the following command to initiate the Command Line client with the -f option and specify the name of the script to execute.
cmd /c DTCL -f "C:\Program Files\DoubleTake\scriptname.txt"
If you do not specify a path for the script file, Double-Take Availability will look in the directory where the DTCL -f command was executed.