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

ParameterDescription
InterpreterInterpreter to execute command.
Script fileThe path to the file from the resource containing the script to be executed.
ArgumentsSet of arguments to start the process with.

Output parameters

ParameterDescription
Completed successfullyA boolean variable that is returned when the process ends.
TableA 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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
InterpreterInterpreter to execute commandRobin.String
Yes
Script fileThe 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
ArgumentsSet of arguments to start the process with.Robin.String
No
Results
Completed successfullyA boolean variable that is returned when the process ends. True - the script was executed successfully, false - not successfullyRobin.Booleantrue
TableA 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:

  1. Boolean variable where true - script completed successfully, false - not successfully. 
  2. 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

  1. Assemble a robot scheme with the actions:


  2. Set the "Run script file" action parameters. In the "Script file" field specify the path to file RDP.bat


  3. Set the "Take screenshot" action parameters.


  4. Click "Start" in the top panel.

Result

The program robot completed successfully. The machine was put in console mode, the screenshot was taken.

  • Нет меток