Process methods, browser sessions serve 0, phone sessions 0 and computer sessions 4. A method marked not served answers StrategyUnavailable on that kind of session; check the handshake’s capabilities before relying on one.
Process.run
Browser: not served
Phone: not served
Computer: served
Run a command to completion as the session’s user, in the desktop session, with no window, and return its exit code and output. The process is killed when timeoutMs runs out. Computer sessions only.
| Param | Type | Required | Description |
|---|---|---|---|
command | string | Yes | |
args | string[] | No | |
shell | string | No | powershell runs command as a PowerShell script, cmd as a cmd.exe line, none runs command as a program with args. One of powershell, cmd, none. |
cwd | string | No | Defaults to the user’s home folder. |
env | object | No | |
stdin | string | No | |
timeoutMs | integer | No | Default 30000. From 0 to 600000. |
idempotencyKey | string | No | Makes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys. |
| Field | Type | Description |
|---|---|---|
exitCode | integer | -1 when the run timed out. |
stdout | string | |
stderr | string | |
stdoutTruncated | boolean | |
stderrTruncated | boolean | |
timedOut | boolean | |
durationMs | integer |
Process.start
Browser: not served
Phone: not served
Computer: served
Start a program and return at once; a GUI program opens its window on the desktop. Computer sessions only.
| Param | Type | Required | Description |
|---|---|---|---|
command | string | Yes | |
args | string[] | No | |
shell | string | No | powershell runs command as a PowerShell script, cmd as a cmd.exe line, none runs command as a program with args. One of powershell, cmd, none. |
cwd | string | No | |
env | object | No | |
idempotencyKey | string | No | Makes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys. |
| Field | Type | Description |
|---|---|---|
pid | integer |
Process.list
Browser: not served
Phone: not served
Computer: served
The running processes. Computer sessions only.
| Param | Type | Required | Description |
|---|---|---|---|
idempotencyKey | string | No | Makes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys. |
| Field | Type | Description |
|---|---|---|
processes | ProcessInfo[] |
Process.kill
Browser: not served
Phone: not served
Computer: served
End a process. Windows’ own processes and the session’s agent and streamer can’t be killed (InvalidArgs). Computer sessions only.
| Param | Type | Required | Description |
|---|---|---|---|
pid | integer | Yes | |
idempotencyKey | string | No | Makes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys. |
{}.