Use-cases for the Command-Line Interface

The command-line interface offers ways to help automate many processes involved with AnyDesk. Here, you can find some examples of how to use it with AnyDesk.

Automatic Deployment

The command-line features can be used in combination with software management/deployment tools to deploy and set up AnyDesk on a larger number of devices without the need for manual intervention on each device.

For this case, we would recommend providing an MSI installation package as well as preconfigured Customer/Service-Module versions of our .exe and .msi files that can easily be distributed this way.

These can be customized further through the custom client generator on “my.anydesk.com“.

Standard Module Types Description
Standard MSI MSI version of the standard client from anydesk.com that can both initiate and receive connections.
Customer Module MSI MSI version of a standard client that can only receive connections.
Service Module MSI MSI version of a standard client that can only initiate connections.
Default EXE EXE version of the standard client from anydesk.com that can both initiate and receive connections.
Customer Module EXE EXE version of a standard client that can only receive connections.
Service Module EXE EXE version of a standard client that can only initiate connections.

These can then be deployed automatically through a script using the commands described in the Installation Commands or through other deployment tools.

An example batch script, that will install AnyDesk, register the license key, and set a password, could look like this:

@echo off 
AnyDesk.exe --install "C:\Install\AnyDesk\Here" --start-with-win --silent --create-shortcuts --create-desktop-icon
echo licence_keyABC | "C:\Install\AnyDesk\Here\AnyDesk.exe" --register-licence
echo password123 | "C:\Install\AnyDesk\Here\AnyDesk.exe" --set-password

Removing AnyDesk

In case AnyDesk is no longer needed on certain machines, it can be uninstalled through the in-built operating system uninstaller or alternatively, the command-line interface.

This can be done using either the --remove or --uninstall command as mentioned in Installation Commands.

--uninstall will start the uninstallation process for the AnyDesk client. Using this command, a GUI prompt will appear which will guide the user through the uninstallation process.

Uninstall AnyDesk GUI prompt

In case the removal of AnyDesk is supposed to happen purely via a script or through management software, --remove is the right parameter to use.

Furthermore, if a completely silent removal is intended, appending --silent will prevent error messages that might occur during the removal process from showing up.

An example for a silent removal without additional user input would be:

anydesk.exe --silent --remove

--remove will only uninstall the AnyDesk application from the Windows operating system but cannot remove any remnant files. Files such as those found in the below default directories must be manually deleted or deleted through a script.

C:\Program Files (x86)\AnyDesk 
%appdata%\AnyDesk
%programdata%\AnyDesk

Connecting through the Command-Line Interface

If AnyDesk is intended to be implemented into already existing software, connecting through the command-line interface using the commands and parameters as described in Connection Commands can be a good tool to achieve that.

Modifying AnyDesk shortcuts

Parameters found in Connection Commands can be used to modify shortcuts that have been dropped to the desktop through AnyDesk.

CMDUseCaseConnectDropToDesktop

This is done by appending a parameter to the "Target" field in "Properties" of the desktop shortcut. For example: 

"C:\Program Files (x86)\AnyDesk\AnyDesk.exe" 123456789 --plain

CMDUseCaseShortcut-300x75