Task Variables via command-line

Task variables are dynamically generated when your task runs. This feature provides the command-line code required to get the value of the Task Variable. You can use this command-line code, from an external program, script, batch file, or command-line (command prompt in windows or terminal in Unix).  The command-line and working directory required to get the variable will be automatically generated in the text fields.  

A) Getting Task variable values to use in scripts or batch files
From the command-line via your batch files or scripts etc,
first set the program install folder as the current directory
cd install_folder

on windows, use:
jre\bin\java.exe -cp .;hitek.jar com.hitek.engine.mods.var.TaskVariable get variable_name
jre\bin\java.exe -cp .;hitek.jar com.hitek.engine.mods.var.TaskVariable get variable_name c:\test\test.txt    (will output the variable to the file test.txt)

IMPORTANT: variable_name cannot include any spaces in it

on Unix/MacOSX, use:
java -cp .:hitek.jar com.hitek.engine.mods.var.TaskVariable get variable_name
java -cp .:hitek.jar com.hitek.engine.mods.var.TaskVariable get variable_name /home/test.txt   (will output the variable to the file test.txt)

where variable_name = to variable name, and variable_value = to variable value

The variable value will be returned as a string value in the system output stream. You should add code in your batch or script or program to read this value

Also, if the variable is an integer, the exit code of the command above is the integer value of the variable.  If the variable is not an integer, the exit code of the command above = -1001. If there is any error in your syntax, the exit code = 1000.

B) Setting your own task variables for the program (Automize, AbleFtp etc..) to recognize

It is not recommended to set or change task variables from the command-line. These task variables are dynamically generated when a task runs, and will overwrite any new variable you enter. You should instead set user defined variables, using the UserVariables feature.

From the command-line via your batch files / scripts etc, first set the program install folder as the current directory
cd install_folder (i.e. cd ..\Automize or cd ..\AbleFtp etc..)

on windows, use:
jre\bin\java.exe -cp .;hitek.jar com.hitek.engine.mods.var.TaskVariable set variable_name variable_value

IMPORTANT: variable_name cannot include any spaces in it

on Unix/MacOSX, use:
java -cp .:hitek.jar com.hitek.engine.mods.var.TaskVariable set variable_name variable_value

where variable_name = to variable name, and variable_value = to variable value