---
Title: Execute instances
URL Source: https://company-skill.com/p/ecs/ecs-execute-instances
Language: en
Description: You want to run shell scripts or commands on one or more Alibaba Cloud ECS instances without using SSH/RDP, typically for maintenance, configuration, or automation tasks. Typical User Questions: How…
---

# Execute instances

Part of **Elastic Compute Service (ECS)**. Route queries via `POST https://company-skill.com/api/route`.

## What You Want to Do

You want to run shell scripts or commands on one or more Alibaba Cloud ECS instances without using SSH/RDP, typically for maintenance, configuration, or automation tasks.

**Typical User Questions**:
- How to run shell commands remotely on multiple ECS instances?
- Can I schedule recurring maintenance scripts?
- How to clone an existing Cloud Assistant command?
- What if Cloud Assistant fails due to DNS issues?

## Decision Tree

Pick the best path for your situation:

- **If** you prefer a graphical interface and need to quickly run or manage commands like **Execute Command**, **Create /Run Command**, or **Clone Command** → Use Cloud Assistant (go to *ecs/ecs-cloud-assistant*)
- **If** you need to trigger command execution programmatically using APIs like **InvokeCommand** or **SendFile** within an automated system → Use APICloud Assistant (go to *ecs/ecs-instance*)
- **If** your command targets more than 50 instances in a single operation → Neither path supports this; both have a **max_concurrency of 50**
- **Otherwise (default)** → Start with **Cloud Assistant** if you're performing ad-hoc tasks and lack development resources

## Path Comparison

| Path | Best For | Complexity | Code Required | Automation | Key Fact | Detail Skill |
|------|----------|------------|---------------|------------|----------|-------------|
| Cloud Assistant | low | No | No | 0.001100 | `ecs/guide/ecs-cloud-assistant` |
| APICloud Assistant | medium | Yes | Yes | Requires coding to call **InvokeCommand** or **DescribeInvocations** | `ecs/api/ecs-instance` |

## Path Details

### Path 1: Cloud Assistant

**Brief Description**: The ECS Cloud Assistant console is a web-based GUI that lets you run commands via **Execute Command**, manage templates with **Create /Run Command** and **Clone Command**, upload files using **Send File**, and configure settings like **Command Content**, **Execution Mode**, **Timeout Period**, and **Execution Path**—all without direct SSH access, provided the instance is in **Running state** and has the **Cloud Assistant Agent** installed.

**Key technical facts**:
- Billing: 0.0011000.001

- 16 KB Base64

### Path 2: APICloud Assistant

**Brief Description**: This path uses Alibaba Cloud APIs such as **InvokeCommand**, **DescribeInvocations**, **DescribeInvocationResults**, and **SendFile** to programmatically execute commands on ECS instances. It requires the target instances to be in **Running state** with the **Cloud Assistant client** installed and proper RAM permissions.

**Key technical facts**:
- Max concurrency: 50 instances per API call

**When NOT to Use**:
- API32 KB Base64

- Base6432 KB

- Cloud Assistant

## FAQ

Q: Which path should I start with?
A: If you're running occasional commands and don’t have developers available, start with the Cloud Assistant console. If you’re building an automated system, use the API path.

Q: What if I need to run a 20 KB script but used the console path?
A: You'll hit the **16 KB Base64-encoded command size limit** and the command will fail to submit—use the API path won’t help either, as both share the same underlying Cloud Assistant limits.

Q: What if I try to automate daily log cleanup using the console path?
A: You’ll have to manually click **Execute Command** every day—since the console isn’t automation-friendly, you can’t integrate it into a scheduler without screen-scraping (not recommended).

Q: Can I edit a saved command in the console?
A: No—you can only **Clone Command** or delete and recreate it, as direct editing isn’t supported.

Q: What happens if my instance isn’t in Running state when I call InvokeCommand?
A: The API call will fail because both paths require the instance to be in **Running state** and have the **Cloud Assistant client** active.

Q: Does the API path cost more than the console?
A: No—both use the same Cloud Assistant backend and billing model (0.001 per command), though the console includes free monthly quotas visible in the UI.

## Related queries

execute remote command, run shell remotely, batch run command, remote exec, execute script on ECS, Cloud Assistant console, invoke command via API, schedule maintenance script, clone Cloud Assistant command, install Cloud Assistant client, DNS failure Cloud Assistant, how to run command on ECS, ECS

---
Part of [Elastic Compute Service (ECS)](https://company-skill.com/p/ecs.md) · https://company-skill.com/llms.txt
