Runs a PowerShell or bat command on one or more cloud desktops.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes RunCommand

The operation that you want to perform. Set the value to RunCommand.

CommandContent String Yes ipconfig

The plaintext content or the Base64-encoded content of the command.

The Base64-encoded command content cannot exceed 16 KB in size.

Note If the command content is Base64-encoded, you must set ContentEncoding to Base64.
DesktopId.N RepeatList Yes ecd-7w78ozhjcwa3u****

The ID of cloud desktop N. Valid values of N: 1 to 50.

If multiple cloud desktops are specified and the command succeeds for one or more of these cloud desktops, the operation is considered successful. If multiple cloud desktops are specified and the command fails for all of these cloud desktops, verify the values of the parameter and try again.

RegionId String Yes cn-hangzhou

The ID of the region.

Type String Yes RunPowerShellScript

The language of the O&M command. Valid values:

  • RunBatScript
  • RunPowerShellScript
Timeout Long No 3600

The timeout period for the command to run. Unit: seconds. Default value: 60.

A timeout error occurs when the command cannot be executed because the process slows down or because a specific module or the Cloud Assistant client does not exist. When a timeout error occurs, the command process is forcibly terminated.

ContentEncoding String No Base64

The encoding mode of the command content. Valid values:

  • PlainText: The content of the command is not encoded and is transmitted in plaintext.
  • Base64: The content of the command is encoded in Base64.

Default value: PlainText. If the specified value of this parameter is invalid, PlainText is used by default.

Response parameters

Parameter Type Example Description
InvokeId String t-hz01qgsqj2n****

The ID of the command execution.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.


Sample requests
&<Common request parameters>

Sample success responses

XML format


JSON format