Plugin operates with two types of variables — internal and environmental variables. The only difference between them is only that the internal variables are only visible in the plugin, and the environment variables are available for Total Commander and programs, that run from it.
In general, a variable name can only contain Latin letters, numbers, and the underscore «_». Internal variables are set with Set command, and environment variables with SetEnv. When you use variables in the command, Autorun does not differentiate between them and can get their values from both, but writing from the commands is available only into internal variables (the obvious exception — SetEnv). However, this behavior can be changed by AutorunAllowWriteEnv directive.
When you use variables in the command follow a simple rule: if the value is reading («expanding»), the variable must be wrapped around with percent «%». If the variable is writing (commands Set, SetEnv, and others), its name is written as is. Example:
Set MY_COMMANDER_PATH %COMMANDER_PATH%
In the above example, the environment variable COMMANDER_PATH will be read and then written to the variable MY_COMMANDER_PATH.
Plugin have few predefined variables (constants):
|%AUTORUN_OSARCH%||The OS architecture where TC is running. This can be either 32 or 64. Equal to %SYSINFO_OSARCH%.|
|%AUTORUN_TCHANDLE%||Total Commander window handle (for using in scripts).|
|%AUTORUN_TCPID%||Total Commander process ID (for using in scripts).|
|%AUTORUN_ISADMIN%||1 if TC executed under admin, else 0.|
|%AUTORUN_TCARCH%||32 or 64 — TotalCommander architecture, where plugin loaded.|
|%AUTORUN_TCCMDLINE%||Commandline of TotalCommander.|
You can not redefine these constants.
Additional constants with system information are available in the plugin SysInfo.
Macro variables - special variables, the value of which can change during calls at different times depending on some factors.
|%AUTORUN_TCLANG%||Returns the current language code of Total Commander.|
Autorun has a special ERROR variable. It is usually zero, but some commands may set it to a different value in the case of non-fatal errors (see the documentation for the command). If you need this information, check the value of the variable immediately after the operation, as the following command can change the value of the variable.