Execute Command

This operation type allows you to execute any external NT windows program.  This includes executable (*.exe) or script type (*.bat or *.cmd) files.

Generally the programs expected to be executed by SLIK are non-interactive programs that often take arguments from the command line rather than require user interaction in a window (i.e. GUI).

By using the NT command Remote Shell (“rsh”) you can effectively execute a remote command on the nominated UNIX machine.

Filtered Command

A Filtered Command is a variant of the "Execute Command" operation, which pipes the output of the command looking for certain SLIK key words.  Key words associated with the Filtered Command Operation are:

 $SLIKReturnCode |#|

This overrides the exit return code of the process and is used to determine the command’s result.

If the number (#) is equal to zero then the command is treated as successful. 

If the number is less than zero then this is considered an error condition.   I

If the number returned is greater than zero it is treated as a failed condition that may stops further processing, although it does not log it as an error.

$SLIKErrorText |&|

If the number (#) specified in $SLIKReturnCode is less than zero then the $SLIKErrorText string (&) can be used to report the error message. 

This error text is subsequently used when logging the error in the ErrorLog table.

$SLIKDeleteOutput|#|

This option can be used to control whether the filtered command output is retained or not. 

By default if the return code is greater than or equal to zero the output file is deleted. That is, the output file is only kept for errors (< 0).

Setting the number (#) to non-zero will cause SLIK to delete the output file in all cases.

The output is stored in the SLIKDB.Configuration.OutputDirectory as a text file called cmd-$task_id.txt.  On error it is sent as an attachment in the operator alert e-mail message.  If a successful return code is seen the SLIK server may remove the file on completion. 

Executed and Filtered Commands are created using the following form:

Command Properties Form Field Descriptions

Command ID

The Command ID field holds the system generated unique identifier.  The Command ID field automatically populates on creation of the Command  record.  The Command record is created when you click on OK to save and close the new record.

Field type: system generated

Command

The Command field holds the instruction that is to be carried out.  The first part is considered to be the program name and any text remaining after the first space is treated as command line arguments to the program. If a argument has spaces you can quote these using double quotes.

Field type: free text.

Directory

This determines the current working directory that the command will be executed in.  If not specified then it defaults to the working directory of the SLIK Server process.

Output File

If a value is selected (browse functionality) or entered in this field it defines where the output from the command will be saved.

Field type – browse selection field

Input File

If a value is selected (browse functionality) or entered in this field it defines where the user provided Input file can be found.  The contents of the file is attached to the “standard-input” of the new process.  This mechanism provides a simple way to supply input to a program that expects to be interacting with a user rather being run in non-interactive batch mode.

Field type – browse selection field

Domain

Optionally you can specify that the command should be executed with security rights of a  specific NT domain and user account.

User Name

If this Operation is to be run with a specific user security then this field holds the associated username value.

Field type – free text field.

Password

If this Operation is to be associated with a specific user security, and the user’s login requires a password, the password record is held in this field.    Note: the password is encrypted.

Field type – free text field.

Comparison Operator

If this Operation allows you to prescribe the value for a successful return code, e.g. >=0.

Field type – value selection field.

Status

This field is used to indicate to SLIK what should be considered a successful return code status. If not specified then the command is considered successful if the command exits with a return code of >= 0.

Field type – free-text field.  (Numeric)

Timeout

This field is used to indicate whether a timeout function applies to this Command and if so, how long it takes before the timeout function actions.

Field type – check box and integer field.

Terminate on Timeout

This field is used to indicate whether the Operation is to terminate if the Timeout limit is reached.

Field type – check box.

Show Window

The Show Window field allows you to control the appearance of the commands window.  Options available from the drop-down list are:

Hide – hides the command window and activates an alternative window.

Normal – default window display.

Minimised – selecting this value will cause the window to be activated and displayed as a minimized window. 

Maximise – selecting this value will cause the window to be maximized when.

No Activate – selecting this value will cause the window to be visible but focus will not be available.

Show – selecting this option will cause the window to display in its currency size and position.

Minimise – selecting this value will cause the window to be minimized and the next top-level window to be active.

Showminnoactive – selecting this value will cause the window to display as a minimized window.

Showna – selecting this value will cause the window to display in its current size and position.

Restore – selecting this value will cause the window to activate and display in its original size and position.

Showdefault – selecting this value sets window show state based on the value specified in the STARTUPINFO structure passed to the create process function.

Forceminimise – selecting this option causes the window to be minimized, even if the thread associated with the window is hung.  Note this open should only be used when minimising windows from a different thread.

Note: these value names conform to the Windows user interface standard.

Field type – value selection field.

Interact With Desktop

Instructs SLIK server process for this command to display the command window to the NT console.

Field type – check box