User Defined Variables
This feature provides the commandline code to set an existing variable, add a new variable, or get the value of a 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 set 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) Setting your own variables for the program (Automize, AbleFtp etc..) to recognize
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 UserVariable set variable_name variable_value
IMPORTANT: variable_name cannot include any spaces in it
on Unix/MacOSX, use:
java -cp .:inputs:jclasses.jar UserVariable set name value
where variable_name = variable name, and variable_value = variable value
B) Getting User 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 UserVariable get variable_name
jre\bin\java.exe -cp .;inputs;jclasses.jar UserVariable 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 UserVariable get variable_name
java -cp .:inputs:jclasses.jar UserVariable 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.