Command Line Interface

Advanced users can control AnyDesk from scripts using the command line. AnyDesk uses the pipe mechanism of the operating system in some cases instead of parameters for higher security.

See also: exit codes.


AnyDesk.exe [id|alias|--control|--start-service|--with-password|--set-password|--get-alias|--get-id|--register-license][--silent]
Parameter Description
This starts the process which creates the tray icon.
During installation, AnyDesk creates a link with this parameter in the autostart start menu entry.
This process also handles the clipboard.
Start the AnyDesk service, if not already running.
Read the password from stdin and connect to the alias given in the command line using the password.
Sets a password.
Gets the current AnyDesk alias.
Gets the current AnyDesk ID.
Returns the network status of AnyDesk (online or offline).
Registers a licence key with AnyDesk. 
--silent AnyDesk will not display message boxes when this parameter is specified. Recommended for scripts.
For installation parameters, see Automatic Deployment.

Obtaining Alias and Id

To get the AnyDesk-Alias or Id of the currently installed and running AnyDesk, you can use the following syntax:

anydesk --get-alias
anydesk --get-id

AnyDesk will write the requested information to stdout. The service must be running for this to work. If the service is not running, SERVICE_NOT_RUNNING is returned, and an exit code is set indicating the error. If AnyDesk is not installed, it needs to be started first, so it can launch a local service.

For an example, see this windows batch file, which will write the current alias to the console.
@echo off
path=C:\Program Files (x86)\AnyDesk\;%path%
for /f "delims=" %%i in ('anydesk --get-alias') do set CID=%%i 
echo AnyDesk alias is: %CID%

Starting the AnyDesk Service

anydesk --start-service

This requires administrator privileges.

Connecting with password

This example script line connects to alias@ad with password.

echo password | anydesk alias@ad --with-password

Setting a Password

For security reasons, a password can not be set from the command line directly as this would enable malicious users to spy the password from the command line in Task Manager. Instead, a pipe is used to set the password.

echo password | anydesk.exe --set-password

This requires administrator privileges.

Registering Licence Key

You can register a licence with the current AnyDesk installation using the command line. The service must be running.

echo licence_key | anydesk.exe --register-licence

Almost every scripting language has a pipe interface for stdin and stdout. See the programming language documentation for more information.

Uninstalling without notice (silent uninstall)


Feedback and Knowledge Base