Task Variables via commandline

Task variables are dynamically generated when your task runs. This feature provides the commandline code to get the value of the Task Variable from an external program, script, batch file, or commandline (command prompt in windows or terminal in unix).  The commandline and working directory required to get the variable will be automatically generated in the text fields.  In the commandline code, you would need to replace the term 'variable_value' with the value you need for this parameter. You can use the "Copy to Clipboard" feature to copy these fields to clipboard for use in your scripts or programs.
 

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

on windows, use:
jre\bin\java.exe -cp .;inputs;jclasses.jar TaskVariable get variable_name
jre\bin\java.exe -cp .;inputs;jclasses.jar 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 .:inputs:jclasses.jar TaskVariable get variable_name
java -cp .:inputs:jclasses.jar TaskVariable get variable_name /home/test.txt   (will output the variable to the file test.txt)

where variable_name = variable name, and variable_value = 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 that you set or change task variables from the commandline. 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 commandline 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 .;inputs;jclasses.jar TaskVariable set variable_name variable_value

IMPORTANT: variable_name cannot include any spaces in it

on Unix/MacOSX, use:
java -cp .:inputs:jclasses.jar TaskVariable set variable_name variable_value

where variable_name = variable name, and variable_value = variable value