Skip to content

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.

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:

:label

Serves 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:

$crcarriage return.
$usernameContents of the User Name edit box in the AutoLogon configuration. See WorkStation Manager manual (TbredComm AutoLogons tab).
$wusernameContents 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 string

Sets a variable name to contain the string.

goto :label

The next command to execute is the command following the line with the :label command.

pause seconds

Pause execution for specified number of seconds.

quit

Stops execution of the script.

abort

Stops execution of TbredComm immediately .

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 $cr
waitfor login
send $user

This 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 $cr
input $user "Enter user name"
waitfor login
send $user

This example waits until the remote host is connected before the script executes, because the first script command is send $cr.

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$cr
waitfor Password:
send $password$cr

Example 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$cr
waitfor Password:
send $password$cr
waitfor Web/SM
send .$cr

Example 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$cr
waitfor Password:
send $password$cr
waitfor tsi]$
send TERM=TBREDCON$cr
waitfor tsi]$
send export TERM$cr
waitfor tsi]$
send cd /usr/basic$cr
waitfor tsi]$
send ./basic IPLINPUT
pause 1
send S$cr
pause 1
send $cr

Example 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 sendnull
send $u$cr
waitfor Password:
input 'Enter password' $p sendnull
send $p$cr
goto exit
:sendnull
send $cr
:exit
quit

Example 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 abortnow
send $u$cr
waitfor Password:
input 'Enter password' $p abortnow
send $p$cr
goto exit
:abortnow
abort
:exit
quit

Example 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$cr
waitfor Password:
input 'Enter password' $p abortnow
send $p$cr
goto exit
:abortnow
abort
:exit
quit

From the TbredComm Reference, version 8.9.1. Open this page in the PDF