run_host_command
Execute Command Prompt commands on remote devices in Packet Tracer. Capture ping, ipconfig, tracert output; timeouts stop long-running commands.
Instructions
Run a command in the Command Prompt of a PC, laptop or server (ping, ipconfig, tracert, nslookup, arp -a) and return its output. Waits until the command finishes; a command still running after timeout_secs (ping -t) is stopped with Ctrl+C and comes back with finished: false and the output so far.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | Yes | PC, laptop or server name as returned by `list_devices`. | |
| command | Yes | Command Prompt command, for example `ping 192.168.1.1` or `ipconfig /all`. | |
| timeout_secs | No | Seconds to wait for the command to finish. Defaults to 30, maximum 300. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | ||
| status | No | ||
| finished | Yes | ||
| question | No | The question the command is waiting on, such as `Proceed with reload? [confirm]`. Answer it with another call in `current` mode; an empty command presses Enter. |