AutoLogon Scripts
An AutoLogon script is associated with an AutoLogon configuration. When TbredComm is started using an AutoLogon configuration, it will execute the appropriate script. Scripts are selected using the WorkStation Manager (TbredComm AutoLogons tab).
Each AutoLogon configuration must be associated with a script file. The WorkStation Manager tab allows users to pick a script file for an AutoLogon configuration. Script files are simple ASCII text files that may be maintained with Notepad or any text file editor. Script files are located in the Tbredcom-data-path\Tsi\Scripts directory.
Script File Commands
Section titled “Script File Commands”The script commands are listed below. Each command is shown using in the following syntax notation:
[ ]Square brackets indicate an option item.
[ok-label]
{ }Braces indicate that one of the enclosed items is required. A vertical line (piping) separates the items.
{varname|string}A string is defined as a sequence of text characters that may contain embedded spaces. Stings are not enclosed in quotes except in the input command when a string must be enclosed in double quotes ( “ ) or single quotes ( ’ ).
varname is a variable name that can be from 2 to 8 characters and must begin with a ‘$’
The commands currently supported include:
:labelServes as a label for a script branch. May be followed by one or more commands to execute conditionally. See the input and goto commands.
waitfor{varname|string}When the script engine sees this command it waits for the string specified or the string contained in the variable name to arrive from the host. The command will wait until either the overall AutoLogon timeout occurs or the host issues a timeout and disconnects. For more information see the WorkStation Manager manual (TbredComm AutoLogons tab).
send{varname|string}The script engine sends the string or contents of the variable name to the host. The script engine always knows the following variable names:
$cr | carriage return. |
$username | Contents of the User Name edit box in the AutoLogon configuration. See WorkStation Manager manual (TbredComm AutoLogons tab). |
$wusername | Contents of the Windows User Name. See WorkStation Manager manual (TbredComm AutoLogons tab). |
$password |
Contents of the Password edit box in the AutoLogon configuration. See WorkStation Manager manual (TbredComm AutoLogons tab).
input varname "string"[cancel-label[ok-label]]The script engine displays a dialog box. Enter a string. This string is placed in the variable name supplied. The string supplied is used as a prompt and must be enclosed in double quotes or single quotes.
Press OK to continue the script at the label specified by ok-label. If the ok-label is not supplied, the script continues with the next command in sequence.
Press CANCEL to continue the script at the script command after the cancel-label. In order to specify an ok-label, the cancel-label must also be supplied.
inputpw varname "string"[cancel-label[ok-label]]This command is identical to the input commands above, except the string keyed by the user is echoed as asterisks (*).
set varname stringSets a variable name to contain the string.
goto :labelThe next command to execute is the command following the line with the :label command.
pause secondsPause execution for specified number of seconds.
quitStops execution of the script.
abortStops execution of TbredComm immediately .
When Script Commands are Executed
Section titled “When Script Commands are Executed”Script commands are not executed immediately until a send or waitfor command is encountered. TbredComm waits for a successful connection to the remote host before executing a send or waitfor command. For example, this sequence:
input $user "Enter user name"send $crwaitfor loginsend $userThis example prompts for the $user variable immediately when starting TbredComm. The send $cr command does not execute until the remote host is connected.
Where as the sequence:
send $crinput $user "Enter user name"waitfor loginsend $userThis example waits until the remote host is connected before the script executes, because the first script command is send $cr.
Sample Scripts
Section titled “Sample Scripts”Example 1
The default script, TBDefaultLoginPassword.tcl, uses the user name and password defined in the associated AutoLogon configuration. If either the username or password is not configured, TbredComm prompts the user for inputs. This script cannot be used for Desktop Application Menu selections.
waitfor login:send $username$crwaitfor Password:send $password$crExample 2
The default script**, TBDefaultAppPromtCmd.tcl**, uses the user name and password defined in the associated AutoLogon configuration. If either the username or password is not configured, TbredComm prompts the user for inputs. Use this script for Desktop Application Menu selections.
waitfor login:send $username$crwaitfor Password:send $password$crwaitfor Web/SMsend .$crExample 3
The default script**, TBDefaultWinBasic.tcl**, is an empty script used when making a connection to a TS Environment for Windows using TbredComm. Since no login is required, the script is empty but must exist in the *Tbredcom-data-path\*TSI\Scripts folder.
Example 4
The default script, TBDefaultSSHLogin.tcl is an empty script file and is required when making SSH connections.
Example 5
The following script uses the User Name and Password from the AutoLogon configuration or will prompt the user for one if not defined. It will perform a login and automatically select the Sample System’ from the OPENworkshop menu.
waitfor login:send $username$crwaitfor Password:send $password$crwaitfor tsi]$send TERM=TBREDCON$crwaitfor tsi]$send export TERM$crwaitfor tsi]$send cd /usr/basic$crwaitfor tsi]$send ./basic IPLINPUTpause 1send S$crpause 1send $crExample 6
The following script prompts for a User Name and Password, regardless if the User Name and Password are defined in the AutoLogon configuration. If the user presses Cancel at either prompt, the script terminates. A manual login is allowed.
waitfor login:input 'Enter user name' $u sendnullsend $u$crwaitfor Password:input 'Enter password' $p sendnullsend $p$crgoto exit:sendnullsend $cr:exitquitExample 7
The following script prompts for a User Name and Password, regardless if the User Name and Password are defined in the AutoLogon configuration. If the user presses Cancel at either prompt, TbredComm terminates.
waitfor login:input 'Enter user name' $u abortnowsend $u$crwaitfor Password:input 'Enter password' $p abortnowsend $p$crgoto exit:abortnowabort:exitquitExample 8
The following script uses the Windows User Name and prompts for a Password. If the user presses Cancel at the password prompt, TbredComm terminates.
waitfor login:send $wusername$crwaitfor Password:input 'Enter password' $p abortnowsend $p$crgoto exit:abortnowabort:exitquitFrom the TbredComm Reference, version 8.9.1. Open this page in the PDF