История страницы
...
Run script file Version 10 (Python)
Группа действийAction group: Процессы Processes
Описание
Исполняет заданный скрипт в указанном интерпретаторе
Иконка действия
Параметры
Входные параметры
Интерпретатор Интерпретатор для выполнения команды
Файл скрипта Путь к файлу из ресурса содержащего скрипт, который надо выполнить.
Аргументы Список аргументов, с которыми необходимо запустить скрипт.
Выходные параметры
Завершен успешно Логическая переменная, которая возвращается по завершению процесса.
Таблица Переменная типа Таблица, где в столбце Output записывается результат, в столбце Error ошибка, которая возникла в ходе работы действия, а в столбце ExitCode число 0 или 1, где 0 - скрипт выполнен успешно, 1 - не успешно.
...
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 |
Особые условия использования
В скрипте может содержаться несколько команд, исполняемых последовательно.
Результат исполнения скрипта записывается в две переменные:
- Переменная Логического типа, где true - скрипт выполнен успешно, false- не успешно
- Переменная типа Таблица, где в столбце Output записывается результат, в столбце Error ошибка, которая возникла в ходе работы действия, а в столбце ExitCode число 0 или 1, где 0 - скрипт выполнен успешно, 1 - не успешно.
Пример использования
Задача
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.Перевести машину в консольный режим при помощи запуска bat-файла и сделать скриншот.
Информация |
---|
Запуск робота планируется осуществлять вне 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Программный робот отработал успешно. Выполнен переход в консольный режим, сделан скриншот.