- 入门指南
- 安装和升级
- 机器人类型
- 机器人组件
- 许可
- 将机器人连接到 Orchestrator
- 流程与活动
- 日志记录
- 特定场景
- 监管
- 故障排除

机器人管理员指南
命令行接口
机器人命令行接口 (UiRobot.exe) 是一个控制台应用程序,可用于请求启动作业并等待作业输出。作为机器人服务的直接客户端,其可通过 WCF 通道完成通信。
如要使用机器人支持的命令行参数,请确保 UiPath 机器人服务正在运行。否则,请通过 Microsoft 管理控制台管理单元服务启动该服务。
为便于您处理命令行参数,请使用更改目录命令导航至安装机器人的目录。例如,如果您未更改机器人的默认位置,则可使用以下命令:cd C:\Program Files\UiPath\Studio。
本章中显示的所有示例均基于“您执行了此操作”这一假设构建。
常用 UiRobot.exe 命令
执行
使用此命令即可开始执行以下类型的项目文件:
- JSON
- XAML
- NUPKG
备注:
对于 2023.4 及更高版本的机器人,UiPath 会在执行流程的同时刷新流程列表。如果作业开始时有可用的流程更新,则作业将使用流程的旧版本。后续运行将应用更新后的流程。
该执行命令使用以下参数:
UiRobot.exe execute [--process <Package_ID> | --file <File_Path>] [--folder <Orchestrator_Folder_ID>] [--input <Input_Parameters>]
UiRobot.exe execute [--process <Package_ID> | --file <File_Path>] [--folder <Orchestrator_Folder_ID>] [--input <Input_Parameters>]
-p--process <Package_ID>(必填)- 开始执行本地或 Orchestrator 流程。
示例:
UiRobot.exe execute --process UiPathDemoProcess
UiRobot.exe execute --process UiPathDemoProcess
UiRobot.exe execute -p UiPathDemoProcess
UiRobot.exe execute -p UiPathDemoProcess
-f--file <File_Path>(必填)- 开始执行本地项目文件。目标文件可以是 JSON、XAML 或 NUPKG 格式。
示例:
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
--folder <Orchestrator_Folder_ID>(可选)- 允许您指定 Orchestrator 文件夹,以便在此文件夹中安装和执行目标流程。此参数仅可与--process参数搭配使用。
示例:
UiRobot.exe -Execute --process UiPathDemoProcess --folder OrchFolder1
UiRobot.exe -Execute --process UiPathDemoProcess --folder OrchFolder1
--input <Input_Parameters>(可选) - 用于指定要执行的输入参数。 它可以与--process或--file参数一起使用。
示例:
UiRobot.exe execute --process UiPathDemoProcess --input "{'inArg' : 'value' , 'Integer' : 3}"
UiRobot.exe execute --process UiPathDemoProcess --input "{'inArg' : 'value' , 'Integer' : 3}"
UiRobot.exe execute --process UiPathDemoProcess --folder OrchFolder1 --input "{'inArg' : 'value' , 'Integer' : 3}"
UiRobot.exe execute --process UiPathDemoProcess --folder OrchFolder1 --input "{'inArg' : 'value' , 'Integer' : 3}"
UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml" --input "{'inArg' : 'value' , 'Integer' : 3}"
UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml" --input "{'inArg' : 'value' , 'Integer' : 3}"
--entry <entrypoint>(可选)- 允许您在通过命令行启动流程时选择流程的入口点。
示例:
UiRobot execute --file "C:\UiPath\Project\project.1.0.3.nupkg" --input "{'inArg':'value','integer':3}" --entry "OtherEntryPoint.xaml"
UiRobot execute --file "C:\UiPath\Project\project.1.0.3.nupkg" --input "{'inArg':'value','integer':3}" --entry "OtherEntryPoint.xaml"
- Windows 或跨平台项目不支持以下命令:
UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml"
UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml"
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
- 不能在执行命令中同时使用
--process (-p)和--file (-f)参数。
安装流程
使用此命令即可安装流程。如果机器人已连接到 Orchestrator,它会在 Orchestrator 订阅源中搜索流程。如果还没有连接 Orchestrator,机器人将使用本地订阅源。
安装流程命令使用以下参数:
UiRobot.exe installprocess [--process-name <process_name>] [--folder <orchestrator_folder>]
UiRobot.exe installprocess [--process-name <process_name>] [--folder <orchestrator_folder>]
-
--process-name <process_name>(必填)- 要安装的流程的名称。示例:
UiRobot installprocess --process-name MyProcessUiRobot installprocess --process-name MyProcess -
--folder <orchestrator_folder>(可选) - 包含要安装的流程的 Orchestrator 文件夹的名称。 仅当与 Orchestrator 的连接处于活动状态时,此参数才适用。 如果只有一个文件夹包含安装流程,请跳过此参数。示例:
UiRobot installprocess -p MyProcess --folder MyOrchestratorFolderUiRobot installprocess -p MyProcess --folder MyOrchestratorFolder
连接
使用此命令将机器人连接到 Orchestrator 实例。如果您在机器人已连接到 Orchestrator 的情况下运行此命令,它将返回“Orchestrator 已连接”消息。
连接命令使用以下参数:
UiRobot.exe connect [--url <Orchestrator_Server_URL> --key <Machine_Key>] | [--connectionString <Connection_String>]
UiRobot.exe connect [--url <Orchestrator_Server_URL> --key <Machine_Key>] | [--connectionString <Connection_String>]
connect- 建立与 Orchestrator 的连接。 必须将--url、--key或--clientID --clientSecret参数一起使用。 如果未指定这些参数,则命令将使用 Orchestrator 设置配置。
示例:
// no arguments
UiRobot.exe connect
// no arguments
UiRobot.exe connect
//using the machine key
UiRobot.exe connect --url https://demo.uipath.com/ --key 1122AAB3C-DD44-ABCD-1234-7788GG99HH00
//using the machine key
UiRobot.exe connect --url https://demo.uipath.com/ --key 1122AAB3C-DD44-ABCD-1234-7788GG99HH00
//using the client ID and secret
UiRobot.exe connect --url https://demo.uipath.com/ --clientID 696CCA0C-1234-ABCD-1234-F65BBC2F15DE --clientSecret QJX!jv12345A4q4N
//using the client ID and secret
UiRobot.exe connect --url https://demo.uipath.com/ --clientID 696CCA0C-1234-ABCD-1234-F65BBC2F15DE --clientSecret QJX!jv12345A4q4N
断开连接
使用此命令可断开机器人与当前 Orchestrator 实例的连接。
断开连接命令使用以下参数:
UiRobot.exe disconnect --force | --wait
UiRobot.exe disconnect --force | --wait
-
disconnect- 仅当机器人计算机上没有正在运行的作业时,才断开机器人与 Orchestrator 的连接。示例:
UiRobot.exe disconnectUiRobot.exe disconnect -
--force- 终止计算机上正在运行的所有作业,然后断开机器人与 Orchestrator 的连接。示例:
UiRobot.exe disconnect --forceUiRobot.exe disconnect --force -
--wait- 等待正在运行的作业完成,然后再断开机器人与 Orchestrator 的连接。示例:
UiRobot.exe disconnect --waitUiRobot.exe disconnect --wait
追踪
使用此命令可为机器人启用或禁用低级别追踪。
追踪命令使用以下参数:
UiRobot.exe trace --enableLowLevel | --disableLowLevel
UiRobot.exe trace --enableLowLevel | --disableLowLevel
-
--enableLowLevel- 在“事件查看器”中为机器人执行程序和服务启用 Verbose 追踪。它会生成一个 ETL 文件,您可以使用事件查看器打开该文件,以帮助对崩溃和错误进行故障排除。示例:
UiRobot.exe trace --enableLowLevelUiRobot.exe trace --enableLowLevel -
--disableLowLevel- 为机器人执行程序和服务禁用 Verbose 追踪功能。该功能会生成一个 ETL 文件,您可以使用“事件查看器”打开该文件,以在对崩溃和错误进行故障排除时获得帮助。示例:
UiRobot.exe trace --disableLowLevelUiRobot.exe trace --disableLowLevel
PiP
使用此命令可在计算机上启用或禁用机器人会话或画中画功能。此设置会修改现有安装并被应用于本地计算机上的所有用户。需要管理员权限。
PiP 命令使用以下参数:
UiRobot.exe pip --enable | --disable
UiRobot.exe pip --enable | --disable
-
--enable- 启用计算机的机器人会话(PiP 功能)。示例:
UiRobot.exe pip --enableUiRobot.exe pip --enable -
--disable- 禁用计算机的机器人会话(PiP 功能)。示例:
UiRobot.exe pip --disableUiRobot.exe pip --disable
其他参数
以下参数仅用于提供相关信息,对您的自动化项目没有任何影响:
--version- 显示有关机器人版本的信息。--help- 显示受支持命令的列表,以及相应的信息和示例。flushlogs [--timeout <timeout_in_seconds>]- 将所有待处理的日志发送到 Orchestrator。