You can use cloud assistance commands to perform routine tasks for ECS instances, such as execution of automatic maintenance scripts, process polling, resetting of user passwords, installation and removal of software, application updates, and patch installations. Command types can either be Bat or PowerShell for Windows, or Shell for Linux.


  • Each Alibaba Cloud region can support up to 100 cloud assistant commands.
  • A script cannot exceed 16 KB after being Base64 encoded.

Create commands

To create a command on the ECS Console, follow these steps:

  1. Log on to the ECS console.
  2. In the left-side navigation pane, select Cloud Assistant.
  3. Select the target region.
  4. Click Create Command and then perform the following actions:
    1. Enter a Command Name, for example, HelloECS.
    2. Enter a Command Description, for example, UserGuide.
    3. Click the icon, and select command type from the drop-down list. For Windows instances, you can select either Bat or PowerShell. For Linux instances, you must select Shell.
    4. Enter or paste the contents of your command, such as:
      echo hello ECS!
      echo root:NewPasswd9! | chpasswd
      echo Remmember your password!
    5. Determine the Execution Path of the command. By default, the execution paths of Bat and PowerShell commands are set to the directory where the cloud assistant client is stored, such as C:\ProgramData\aliyun\assist\$(version). Additionally, shell commands are in the /root directory by default.
    6. Set the value for the maximum timeout time (in seconds) for commands in an instance. The default value is 3600. If a command times out, the command process will be forcibly terminated.
    7. Confirm the command details and then click Create.

You can also use the ESC API CreateCommand to create a cloud assistant command.

What to do next

Invoke commands