Run script file Version 10 (Python)
Action group: Processes
Description
The action executes the set script in the specified interpreter.
Action icon
Parameters
Input parameters
Parameter | Description |
---|---|
Interpreter | Interpreter to execute command. |
Script file | The path to the file from the resource containing the script to be executed. |
Arguments | Set of arguments to start the process with. |
Output parameters
Parameter | Description |
---|---|
Completed successfully | A boolean variable that is returned when the process ends. |
Table | A variable of the Table type, where the result is written in the Output column, the Error column contains an error that occurred during the operation of the action, and the ExitCode column contains the number 0 or 1, where 0 - the script was executed successfully, 1 - not successful. |
Settings
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Interpreter | Interpreter to execute command | Robin.String | Yes | |
Script file | The path to the file from the resource containing the script to be executed. The file has the extension .bat for the CommandLine interpreter or .ps1 for the PowerShell interpreter. | Robin.FilePath | Yes | |
Arguments | Set of arguments to start the process with. | Robin.String | No | |
Results | ||||
Completed successfully | A boolean variable that is returned when the process ends. True - the script was executed successfully, false - not successfully | Robin.Boolean | true | |
Table | A variable of the Table type, where the result is written in the Output column, the Error column contains an error that occurred during the operation of the action, and the ExitCode column contains the number 0 or 1, where 0 - the script was executed successfully, 1 - not successful. | Robin.DataTable |
Special conditions of use
A script may contain several commands that are executed sequentially.
The result of the script execution is written to two variables:
- Boolean variable where true - script completed successfully, false - not successfully.
- A Table type variable where the Output column records the result, the Error column records the error that occurred during the action, and the ExitCode column records the number 0 or 1, where 0 means the script was executed successfully, 1 means it was not successful.
Example of use
Task
Put the machine in console mode by running the bat-file and take a screenshot.
Запуск робота планируется осуществлять вне RMC (вручную или по локальному расписанию) на удаленной машине, а окно с RDP-соединением пользователь не планирует оставлять в открытом виде, необходимо перевести текущую RDP-сессию в режиме console (консольный режим).
В консольном режиме графическая сессия остается активной, но при этом RDP-соединение закрыто и не мешает пользователю.
(More about console mode: Starting and operating robots in console mode)
Solution
Use the "Run script file", "Take screenshot" actions.
Implementation
- Assemble a robot scheme with the actions:
- Set the "Run script file" action parameters. In the "Script file" field specify the path to file RDP.bat
- Set the "Take screenshot" action parameters.
- Click "Start" in the top panel.
Result
The program robot completed successfully. The machine was put in console mode, the screenshot was taken.