Anydesk(Command Line Interface)

Original url:

https://support.anydesk.com/Command_Line_Interface

The command line provides a tool to automate AnyDesk using scripts. For some cases AnyDesk uses the pipe mechanism of the operating system instead of parameters for higher security.

Note: The Command Lines work on Windows and partially on Linux.

See also: Exit CodesAutomatic Deployment

Automatic Execution (script/MSI)

AnyDesk can be installed by script with the following command:

anydesk.exe --install <location> --start-with-win

Important:

<location> must be a valid installation path, e.g. c:\anydesk. Currently, AnyDesk must be started with Windows.

For more installation parameters, see Automatic Deployment.

Initialization Parameters

ParameterDescription
--controlStart the process which creates the tray icon. During installation, AnyDesk creates a link with this parameter in the autostart start menu entry (for Windows only).
--trayStart the process which creates the tray icon (for Windows only).
--start-serviceStart the AnyDesk service, if not already running (for Windows, Administrator privileges required).
--serviceStart the AnyDesk service, if not already running (for Linux).
--stop-serviceStop the AnyDesk service.
--restart-serviceRestart the AnyDesk service.
--silentAnyDesk will not display message boxes when this parameter is specified. Recommended for scripts.
--removeUninstall AnyDesk with no notice (silent uninstall).

Get Alias, ID or Status

Note: The AnyDesk service must be running. On Windows, use these commands via batch scripts.

AnyDesk writes requested information to stdout. If the service is not running, SERVICE_NOT_RUNNING is returned and an exit is set indicating the error. If AnyDesk is not installed, it needs to be started first, in order to launch a local service.

On Linux, get AnyDesk Alias or ID of the installed and running AnyDesk, with this syntax:

anydesk --get-alias

anydesk --get-id

anydesk --get-status

Use batch scripts for Windows:

to get ID:

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

to get Alias:

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

to get status:

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

Setting a Password

For security reasons, a password for unattended access 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

Example:

standard client: echo my_new_password | anydesk.exe --set-password

custom client: echo my_new_password | anydesk-123abc456.exe --set-password

This requires administrator privileges.

Registering License Key

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

echo license_keyABC | anydesk.exe --register-license

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

Connection Parameters

To connect to a remote AnyDesk ID or Alias, the syntax is: anydesk.exe alias@ad

The following commands can be added after the destination address (for Windows only):

--file-transferStart the file transfer session.
--fullscreenStart a session with fullscreen mode.
--plainStart a plain session, without window title and toolbar.

Connecting with Password (for Windows only)

Example script that connects to alias@ad with password. Use command line or batch script:

echo password | "C:\Program Files (x86)\AnyDesk\AnyDesk.exe" alias@ad --with-password

 

Other Command Lines (for Windows only)

Open the Settings window:

--settingsor
--admin-settings(for global settings)

To go to the specific setting page, the syntax is:

--settings:ui or capture (User Interface)
 security
 privacy
 video (Display)
 audio
 connection
 file_transfer
 recording
 printer
 license (License Key)
 about (About AnyDesk)

To open global settings:

--admin-settings:capture (User Interface)
 security
 connection
 recording
--plainOpen a plain AnyDesk window. Can be used with AnyDesk connection command.
--disclaimerShow your customized disclaimer
--show-advertShow the advertisement page of AnyDesk. Thank you for sharing! :)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值