# sendkeys

![Parralels](https://www.parallels.com/static/pl/fileadmin/res/img/navigation/pl-logo-dk.png)

## AppserverClient Command Line Interface

### sendkeys

sends keys to an active session.

**Category: Sessions**

```
AppServerClientCLI sendkeys -id rdp:5 -keys "abc<enter>123<enter>" [-wait 5000] [-delay 200]  
```

### Arguments

* **`id (mandatory)`** Specify the ID of the session to where the key inputs are sent.
* **`keys (mandatory)`** Input the keys which are sent to the session.
* **`wait (optional)`** Wait for the specified number of milliseconds before sending keys.
* **`delay (optional)`** Delay each keystroke with the specified number of milliseconds.

### Return codes:

ok - Command was successful\
NotAvailable - Communication with the client backend failed, ensure that the client is running\
InvalidId - Invalid connection, object or session ID\
InvalidArgs - Some arguments are missing or invalid\
InvalidState - Command failed due to invalid state, refer to the command for further information\
Exception - System problem

### Examples:

AppServerClientCLI sendkeys -id rdp:5 -keys\
AppServerClientCLI sendkeys -id session:55435 -keys ABC123

### Notes:

Can be used with RDP connections or a session from both RAS or RDP connection.\
Can send the following keys:\
0-9, a-z, A-Z, f1-f24, space character, and symbol characters like !^#.\
The keyboard layout of the local computer needs to match the remote session.\
Can send the following special keys enclosed in <>:\
ENTER, CTRL+ALT+DEL, BACKSPACE, TAB, HOME, PGUP, PGDOWN, END, LEFT, RIGHT, UP, DOWN, ESCAPE, DELETE, ALT+F4\
Can send the CTRL+ALT to toggle the state of these keys.\
Wait is the time waited, in milliseconds, before the keys are sent.\
Delay is in milliseconds and is per keystroke.

### See also:

[sendmouseevents](/landing/ras-windows-cli-guide/v20/commands/sendmouseevents.md)\
[sendkeyboardevents](/landing/ras-windows-cli-guide/v20/commands/sendkeyboardevents.md)\
[getsessionsinfo](/landing/ras-windows-cli-guide/v20/commands/getsessionsinfo.md)\
[disconnectsession](/landing/ras-windows-cli-guide/v20/commands/disconnectsession.md)\
[uploadfile](/landing/ras-windows-cli-guide/v20/commands/uploadfile.md)\
[downloadfile](/landing/ras-windows-cli-guide/v20/commands/downloadfile.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parallels.com/landing/ras-windows-cli-guide/v20/commands/sendkeys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
