UiPath Documentation
robot
2022.4
false
机器人用户指南
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

命令行接口

机器人命令行接口 (UiRobot.exe) 是一个控制台应用程序,可用于请求启动作业并等待作业输出。作为机器人服务的直接客户端,其可通过 WCF 通道完成通信。

如要使用机器人支持的命令行参数,请确保 UiPath 机器人服务正在运行。否则,请通过 Microsoft 管理控制台管理单元服务启动该服务。

为便于您处理命令行参数,请使用更改目录命令导航至安装机器人的目录。例如,如果您未更改机器人的默认位置,则可使用以下命令:cd C:\Program Files\UiPath\Studio

All the examples displayed in the Arguments Description chapter are constructed from the assumption that you performed this action.

参数说明

为便于您处理命令行参数,请使用更改目录命令导航至安装机器人的目录。例如,如果您未更改机器人的默认位置,则可使用以下命令:

cd C:\Program Files\UiPath\Studio

此处构建的所有示例均基于以下假设:您已首先执行上述命令。

有人值守机器人只能在人工监督下运行。

执行命令

  • UiRobot.exe execute [--process <Package_ID> | --file <File_Path>] [--folder <Orchestrator_Folder_ID>] [--input <Input_Parameters>]

此命令用于启动流程或文件(.json.xaml.nupkg)的执行。请注意,--process (-p) 和 --file (-f) 参数不能与 execute 命令一起使用。它支持以下参数:

参数 描述

-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>

Mandatory. Starts the execution of a local project file. The target file can be .json, .xaml, or .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\Main.xaml"
    UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml"
    
  • UiRobot.exe execute --file "C:\UiPath\Automation\Notepad.1.0.6682.21636.nupkg"
    UiRobot.exe execute --file "C:\UiPath\Automation\Notepad.1.0.6682.21636.nupkg"
    

--folder <Orchestrator_Folder_ID>

Optional. Allows you to specify the Orchestrator folder from which to install and execute the target process. It can only be used together with the --process argument.

示例:

  • UiRobot.exe -Execute --process UiPathDemoProcess --folder OrchFolder1
    UiRobot.exe -Execute --process UiPathDemoProcess --folder OrchFolder1
    

--input <Input_Parameters>

Optional. Allows you to specify input arguments for execution. It can be used with the --process or --file arguments.

示例:

  • 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

允许您在通过命令行启动流程时选择流程的入口点。

示例:

  • 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 或 Portable 项目不支持以下命令:

  • UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"
  • UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml"

打包命令

备注:

For Studio v2018.4.4 and later releases we recommend publishing using the command UiPath.Studio.CommandLine.exe publish instead of UiRobot.exe pack. For more information, see Mass Update Command Line Parameters in the Studio guide.

  • UiRobot.exe pack <Project_Path> --output <Destination_Folder> [-v <Project_Version>]

此命令用于将 Project.json 文件打包成 .nupkg 文件。它支持以下参数:

参数 描述

-o

--output <Destination_Folder>

必填。用于指定创建 .nupkg 文件的位置。

示例:

  • UiRobot.exe pack "C:\UiPath\Automation\Project.json" --output "C:\UiPath\Automation\Packages"

-v <Project_Version>

可选。用于指定 .nupkg 文件的版本。

示例:

  • UiRobot.exe pack "C:\UiPath\Automation\Project.json" --output "C:\UiPath\Automation\Packages" -v 1.0.6820.22047

连接命令

  • UiRobot.exe connect [--url <Orchestrator_Server_URL> --key <Machine_Key>] | [--connectionString <Connection_String>]

    备注:

    如果已经连接了 Robot,则运行 connect 命令将返回以下消息:Orchestrator already connected!

此命令用于将机器人连接到 Orchestrator 实例。它支持以下参数:

参数 描述

connect

Used to connect the robot to Orchestrator, must be used with the --url, --key, or --clientID --clientSecret arguments. If the arguments are not specified, the Orchestrator configuration in Assistant is used to establish the connection.

示例:

  • UiRobot.exe connect

计算机密钥示例:

  • UiRobot.exe connect --url https://demo.uipath.com/ --key 1122AAB3C-DD44-ABCD-1234-7788GG99HH00

客户端 ID 和客户端密码示例:

  • UiRobot.exe connect --url https://demo.uipath.com/ --clientID 696CCA0C-1234-ABCD-1234-F65BBC2F15DE --clientSecret QJX!jv12345A4q4N

断开连接命令

  • UiRobot.exe disconnect

此命令用于断开机器人与当前 Orchestrator 实例的连接。

追踪命令

  • UiRobot.exe trace --enableLowLevel | --disableLowLevel

此命令用于启用或禁用机器人的低级别 (Verbose) 追踪。它支持以下参数:

参数 描述

--enableLowLevel

启用低级别追踪。系统会生成 .etl 文件,您可以使用事件查看器打开此文件,以便排除崩溃和错误问题。这样便可在事件查看器中为机器人执行程序和服务启用 Verbose 追踪功能。

示例:

  • UiRobot.exe trace --enableLowLevel

--disableLowLevel

禁用低级别追踪。停止此功能后,桌面上将生成一个 .etl 文件。您可通过事件查看器打开此文件,以便排除崩溃和错误问题。

示例:

  • UiRobot.exe trace --disableLowLevel

PiP 命令

允许您启用或禁用计算器的画中画功能。此设置适用于本地计算机,并且会影响所有用户,并用于修改现有安装。

需要管理员权限才能执行这些命令。

命令描述
PiP --enable启用计算机的画中画功能。
PiP --disable禁用计算机的画中画功能。

ENABLE_PIP 命令

允许您在 UiPath 命令行安装过程中启用计算机的画中画功能。

命令描述
ENABLE_PIP=1启用计算机的画中画功能。
ENABLE_PIP=0不启用计算机的画中画功能。

其他命令

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

参数描述
--version显示机器人版本的相关信息。
--help显示受支持命令的列表,以及相应的信息和示例。
logs --flush将所有待处理的日志发送到 Orchestrator。
  • 参数说明
  • 执行命令
  • 打包命令
  • 连接命令
  • 断开连接命令
  • 追踪命令
  • PiP 命令
  • ENABLE_PIP 命令
  • 其他命令

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新