Command-Line Interface for Windows

Table of Contents

The following commands can be entered in the Windows command line or can be used in a script in order to automate parts of AnyDesk.

It is important to run these commands in the correct path AnyDesk is located in or to specify the correct path manually.

By default, standard AnyDesk clients from anydesk.com are installed in the following location:C:\Program Files (x86)\AnyDesk\AnyDesk.exe

For custom clients created from my.anydesk.com, they can be found in the following location instead:

C:\Program Files (x86)\AnyDesk-<prefix>\AnyDesk-<prefix>.exe

The <prefix> can be found in the Clients Details page of an existing custom client configuration in the Files tab of my.anydesk.com.

The <prefix> can be found in the row labeled "Prefix" after "ad_". It is randomly generated and unique for each account.

Installation Commands

These commands are used when installing or updating AnyDesk through the command-line interface in the form:

anydesk.exe --install <location> <additional_parameters>

For example:

anydesk.exe --install  “C:\Program Files (x86)\AnyDesk” --start-with-win --create-desktop-icon

On the other hand, the installation of AnyDesk MSI packages simply uses the following command:

anydesk.msi (optional: INSTALL="<location>")

Parameter

Description
--install <location>

Install AnyDesk to the specified <location>.
e.g. C:\Program Files (x86)\AnyDesk

--start-with-win Automatically start AnyDesk with Windows. This is needed to be able to connect after restarting the system.
--create-shortcuts Create start menu entry.
--create-desktop-icon Create a link on the desktop for AnyDesk.
--remove-first Remove the current AnyDesk installation before installing the new one. e.g. when updating AnyDesk manually.
--silent Do not start AnyDesk after installation and do not display error message boxes during installation.
--update-manually Update AnyDesk manually
(Default for custom clients).
--update-disabled Disable automatic update of AnyDesk.
--update-auto Update AnyDesk automatically
(Default for standard clients, not available for custom clients).

Back to Top

Client Commands

These commands can be used to interact with the AnyDesk client through the command-line interface or scripts.

Command Description
anydesk.exe <parameter> See Client Command Parameters.
echo <license_key> | anydesk.exe --register-license Register the specified license key. (Requires administrative privileges)
echo <my_password> | anydesk.exe --set-password Set the specified password for unattended access.

Client Command Parameters

Parameter Description

--uninstall

Uninstall AnyDesk (with prompts).
--remove Uninstall AnyDesk without notice (silent uninstall).

--start

Start the AnyDesk service.
--stop-service Stop the AnyDesk service.
--restart-service Restart the AnyDesk service.
--remove-password

Remove the unattended access password. (Requires administrative privileges).

Please note that preset passwords from custom clients cannot be removed.

--get-alias Return the AnyDesk-Alias. Needs to be run in a script.
--get-id Return the AnyDesk-ID. Needs to be run in a script.
--get-status Return the client's online status. Needs to be run in a script.
--version Return the current AnyDesk client version. Needs to be run in a script.
--settings Open the default settings page.
--admin-settings Open the global settings page.

--settings:<viable_parameter>
Viable parameters:
ui, security, alias, privacy, video, capture, audio, connection, file_transfer, recording, printer, wol, license, about

Open the specified settings page.

--admin-settings:<viable_parameter>

Viable parameters:
capture, security, connection, recording

Open the specified global settings page. (Requires administrative privileges).

--disclaimer

Show the customized disclaimer. This parameter only works on custom clients with the disclaimer enabled.

Client Batch Scripts

Get AnyDesk-ID:

@echo off
for /f "delims=" %%i in ('"C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --get-id') do set ID=%%i
echo AnyDesk ID is: %ID%
pause

Get AnyDesk-Alias:

@echo off
for /f "delims=" %%i in ('"C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --get-alias') do set ALIAS=%%i
echo AnyDesk Alias is: %ALIAS%
pause

Get the online status:

@echo off
for /f "delims=" %%i in ('"C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --get-status') do set STATUS=%%i
echo AnyDesk status is: %STATUS%
pause

Get AnyDesk version:

@echo off
for /f "delims=" %%i in ('"C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --version') do set VER=%%i
echo AnyDesk version is: %VER%
pause

Back to Top

 

Permission Profile Commands (AnyDesk 7+)

Command Description
anydesk.exe --add-profile <name> +<permission> +<permission> ...

Create a permission profile called <name>. By default, all permissions are disabled. If you wish to enable them, add +<permission> to the end of the command with a space in between to separate multiple permissions.

List of <permissions>:

audio          

input          

clipboard      

clipboard_files

block_input    

sas (CTRL+ALT+DEL Action)         

restart        

file_manager    

lock_desk      

sysinfo        

whiteboard      

tcp_tunnel      

vpn            

user_pointer    

privacy_feature

record_session
echo <password> | anydesk.exe --add-profile <name> +<permission> +<permission> ...

Create a permission profile called <name> that can be accessed using the unattended access password <password>.

See above for more information on how to set up permissions for this profile.

echo <password> | anydesk.exe --set-password <profile>

Set the unattended access <password> for an existing <profile>.

For custom profiles, <profile> is simply the name of the Permission Profile.

For default profiles that come with AnyDesk, the following should be used:

Default: _default
Full Access: _full_access
Screen Sharing: _screen_sharing
Unattended Access: _unattended_access
anydesk.exe --remove-password <profile> Removes the unattended access password for <profile>.

Back to Top

Connection Commands

A connection can be established through the command-line interface.
When requesting a connection through the command line, several parameters can be appended.

Command Description
anydesk.exe <ID/Alias> <additional parameters>

AnyDesk will request a connection to the specified client.

See Optional Connection Command Parameters for additional parameters

echo <password> | anydesk.exe <ID/Alias> --with-password AnyDesk will send a connection request to the specified client with the entered password.

Optional Connection Command Parameters.

Parameter Description
--file-transfer AnyDesk will start a File Transfer session.
--fullscreen AnyDesk will start an interactive session in fullscreen mode.
--plain AnyDesk will start an interactive session in a plain window without borders or menu points.

Back to Top

 

Proxy Commands

For more information about the AnyDesk Proxy feature, please see Settings.

Command Description
anydesk.exe --proxy --set-host never

AnyDesk will not connect to a proxy server. This sets Settings > Connection > HTTP-Proxy to "No proxy".

anydesk.exe --proxy --set-host detect

AnyDesk will use a proxy if one is detected. If none can be found or connected to, then continue without connecting to one.

This sets Settings > Connection > HTTP-Proxy to "Detect proxy".

anydesk.exe --proxy --set-host <proxy_type> <address> <port> [<force_proxy>] [--reconnect]

AnyDesk will try to use a specific proxy.

This sets Settings > Connection > HTTP-Proxy to "Manual proxy setup".

proxy_type: http, https or socks
address: URL or IP of the proxy
port: Connection port of the proxy
(optional) +force-proxy: AnyDesk will attempt to connect to the proxy but will function normally if it fails.
(optional) -force-proxy: AnyDesk will only connect via the proxy. AnyDesk will disconnect if the connection to the proxy fails.
(optional) --reconnect: Reconnect to apply the new proxy settings.
anydesk.exe --proxy --set-auth disable

AnyDesk will not send any authentication credentials.

This sets Settings > Connection > HTTP-Proxy to "No authentication required".

anydesk.exe --proxy --set-auth auto

AnyDesk will use the Windows credentials as authentication.

This sets Settings > Connection > HTTP-Proxy to "NTLM".

echo <password> | anydesk.exe --proxy --set-auth simple <username>

AnyDesk will use the configured username and password for authentication.

This sets Settings > Connection > HTTP-Proxy to "Set up username and password".

Back to Top