Run Telnet Command
Executes the command Telnet informed on an open connection with the server.
Command availability: IBM RPA SaaS and IBM RPA on premises
Dependencies
You must open a Telnet session with the Start Telnet Connection (startTelnet
) command.
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
executeTelnet --client(TelnetSession) --command(String) [--timeout(TimeSpan)] (String)=value
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Telnet Connection | client |
Required |
Telnet Session |
Variable containing the data of the established Telnet connection. The connection is established by the Start Telnet Connection command. |
Command | command |
Required |
Text |
Telnet command that should be executed. |
Timeout | timeout |
Optional |
Time Span, Number, Text |
Waiting time for the execution. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Return Text | value |
Text |
Result of executing the command. |
Example
The Start Telnet Connection command initiates a Telnet connection. Then, the Command parameter is set to "status" within the request. Finally, the Terminate Telnet Connection command closes the connection.
defVar --name telnetConnection --type TelnetSession
defVar --name textReturn --type String
// Connection to Telnet server established.
startTelnet --host "125.64.124.77" --username "User Name" --password Password --port 23 --timeout 00:00:05 telnetConnection=value
executeTelnet --client ${telnetConnection} --command status --timeout 00:00:12 textReturn=value
closeTelnet --client ${telnetConnection}
// The example above demonstrates the connection to a specified Telnet server to send commands. All host, port and connection data are for example only, requiring the client services and Telnet server to be installed.