robot
2025.10
false
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

机器人管理员指南

上次更新日期 2026年1月14日

Robot 命令行界面

UiPath 机器人命令行接口是一个工具,让您能够通过命令行终端与机器人交互。它使用 UiRobot.exe 文件,可直接通过命令行启动、停止或监控 Attended 和 Unattended 自动化。您还可以获取有关已安装包的详细信息、创建日志或更新配置。

工作方式

要使用 CLI,请确保以下方面:

  • UiPath 机器人服务正在运行
  • 您位于安装机器人的目录中。

然后,根据您希望自动化实现的目标,键入引用 UiRobot.exe 程序的说明或命令以及必要的参数。

例如,要通过命令行启动流程,您可以使用以下命令:

UiRobot.exe -file "C:\UiPath\Projects\YourProject\Main.xaml".
UiRobot.exe -file "C:\UiPath\Projects\YourProject\Main.xaml".

常用 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 MyProcess
    UiRobot installprocess --process-name MyProcess
    
  • --folder <orchestrator_folder> (可选)- 包含要安装的流程的 Orchestrator 文件夹的名称。此参数仅在与 Orchestrator 的连接处于活动状态时适用。如果只有一个文件夹包含要安装的流程,请跳过此参数。示例:
    UiRobot installprocess -p MyProcess --folder MyOrchestratorFolder
    UiRobot 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 disconnect
    UiRobot.exe disconnect
    
  • --force - 终止计算机上正在运行的所有作业,然后断开机器人与 Orchestrator 的连接。示例:
    UiRobot.exe disconnect --force
    UiRobot.exe disconnect --force
    
  • --wait - 等待正在运行的作业完成,然后再断开机器人与 Orchestrator 的连接。示例:
    UiRobot.exe disconnect --wait
    UiRobot.exe disconnect --wait
    

Trace

使用此命令可为机器人启用或禁用低级别追踪。

追踪命令使用以下参数:

UiRobot.exe trace --enableLowLevel | --disableLowLevel
UiRobot.exe trace --enableLowLevel | --disableLowLevel
  • --enableLowLevel - 在“事件查看器”中为机器人执行程序和服务启用 Verbose 追踪。该功能会生成一个 ETL 文件,您可以使用“事件查看器”打开该文件,以在对崩溃和错误进行故障排除时获得帮助。示例:
    UiRobot.exe trace --enableLowLevel
    UiRobot.exe trace --enableLowLevel
    
  • --disableLowLevel - 为机器人执行程序和服务禁用 Verbose 追踪功能。该功能会生成一个 ETL 文件,您可以使用“事件查看器”打开该文件,以在对崩溃和错误进行故障排除时获得帮助。 示例:
    UiRobot.exe trace --disableLowLevel
    UiRobot.exe trace --disableLowLevel
    

PiP

使用此命令可在计算机上启用或禁用机器人会话或画中画功能。此设置会修改现有安装并被应用于本地计算机上的所有用户。需要管理员权限。

PiP 命令使用以下参数:

UiRobot.exe pip --enable | --disable
UiRobot.exe pip --enable | --disable
  • --enable - 启用计算机的 Robot 会话(PiP 功能)。示例:
    UiRobot.exe pip --enable
    UiRobot.exe pip --enable
    
  • --disable - 禁用计算机的机器人会话(PiP 功能)。 示例:
    UiRobot.exe pip --disable
    UiRobot.exe pip --disable
    

其他参数

以下参数仅用于提供相关信息,对您的自动化项目没有任何影响:

  • --version - 显示有关机器人版本的信息。
  • --help - 显示受支持命令的列表,以及相应的信息和示例。
  • flushlogs [--timeout <timeout_in_seconds>] - 将所有待处理的日志发送到 Orchestrator。
  • 工作方式
  • 常用 UiRobot.exe 命令
  • 执行
  • 安装流程
  • 连接
  • 断开连接
  • 追踪
  • pip
  • 其他参数

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2026 UiPath。保留所有权利。