This article applies to all TeamViewer users with Windows or macOS.
Some parameters are only available with TeamViewer version 13.2.

Command line parameters on Windows

How to use?

Parameters with and without value

There are two types of parameters, with value and without value.
Example for a parameter without value: 

TeamViewer.exe --noInstallation

Example for a parameter with value: 

TeamViewer.exe --id 123456789

In most cases, only one value is expected, if multiple are given, only the first one is used.
If the value of a parameter contains a space, the value must be enclosed in "".

Miscellaneous Info

A long parameter is called like this (with two “-“ -> “--“): TeamViewer.exe --Minimize
If the parameter has a short variant, it can also be called with only one “-“: TeamViewer.exe -n

However, using “--n” is also possible on some platforms. Multiple parameters can be combined in one call and parameters are case-sensitive.

Command Line Tasks

Usually when command line parameters are passed, TeamViewer will keep running. However, there are some "tasks" which can be triggered via command line, after which TeamViewer will close itself.

Tasks:

  • Device Assignment
  • COM API Installation

Application

Following options are supported:

 
Parameter Short variant Description
Minimize  

Start TV minimized.

If "Start TV with windows" is enabled, TV will be started in tray instead.

id  i

Starts a connection to given partner id.

Password P

Used in combination with "id". Password to use for the connection.

PasswordB64 B

Used in combination with "id". Base64 encrypted password to use for the connection.

mode m

Used in combination with "id". Connection mode to use for the connection.

If omitted, remote control is used.

Supported values:

  • fileTransfer
  • vpn

Example: --mode fileTransfer

quality q

Used in combination with "id". Connection quality setting to use for the connection.

Supported values:

1: automatic quality selection
2: optimize quality
3: optimize speed
4: custom settings
5: undefined

Example: --quality 2

ac a

Used in combination with "id". Access control rights to use for the (outgoing) connection.

 Supported values:

0: full access
1: confirm all
2: view and show
3: custom
9: undefined

Example: --ac 1

play  

Play a TeamViewer session file (*.tvs)

Example: Teamviewer.exe  --play C:\Users\shvarts\Desktop\A\abc.tvs

control  

Start a connection (RC/Meeting) to an id specified in given control file (*.tvc).

Where to find *.tvc files:
%appdata%\TeamViewer\MRU\RemoteSupport
%appdata%\TeamViewer\MRU\Meeting

Example: Teamviewer.exe  --control C:\Users\shvarts\Desktop\A\abc.tvc

ProxyIP  

Proxy IP and Port, formatted like: IPAddressSmiley Tongueort

Example: Teamviewer.exe --ProxyIP 192.168.0.2:8080

ProxyUser  

Used in combination with "ProxyIP".
Proxy Username

Example: Teamviewer.exe --ProxyIP 192.168.0.2:8080 --ProxyUser admin

ProxyPassword  

Used in combination with "ProxyIP". Proxy Password Base64 encoded

Example: Teamviewer.exe --ProxyIP 192.168.0.2:8080 --ProxyUser admin --ProxyPassword test

sendto  

Send a list of files to a partner in your partner list.

Prompts may open for login and selection of recipient.

Example:
Single file: Teamviewer.exe --sendto C:\Users\shvarts\Desktop\A\abc.jpg
Multiple files: Teamviewer.exe --sendto C:\Users\shvarts\Desktop\A\abc.jpg C:\Users\shvarts\Desktop\A\abcd.jpg

 

Device assignment

On Windows the assignment task is started like this:

TeamViewer.exe assign <options>

 On macOS it is started like this:

Host version: 

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment <options>

 Full version:

sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment <options>

 "sudo" is required to obtain admin rights, because AssignmentData.json is written with restricted rights by TeamViewer_Service. The tool can only be executed from within the app bundle, otherwise the tool cannot find its required frameworks.

If the value (e. g. group) contains a space, the value must be enclosed in "", or each space must be encapsulated with "\" on macOS.
Use “--" for Windows in front of each option and “-“ for macOS in front of each option.

Following options are supported:

Option Required Default Value Description

api-token

 yes

 

Token needed to access the API, which could be generated in the management console (e. g. in "Profile settings / Apps"). Tokens for Easy-Rollout of custom hosts can also be used.

alias

   

Alias for the new device in the computers & contacts list. If the device is already in the contact list, no alias will be applied.

grant-easy-access

 

false

Grants easy access after assignment (same as the "Grant easy access" option in the TeamViewer main window)

reassign

 

false

Assigns the device to the account even if the device is already assigned to an account.

wait

 

10

Waiting time in seconds for which the assignment will wait for the data file to be created. Usually the default value is sufficient.

group

*

 

Name of the group in which the device will be added. When the group doesn't exist, it will be automatically created. If the device is already present in the computers & contacts list in a different group, it won't be moved to the group.

* Only required if no custom host is used, because the group is already defined in the custom configuration.

group-id

   

This option is an alternative to use the --group parameter if the id of the group is known. This might be useful in very large customer environments as it speeds up the assignment process. Usually using --group is sufficient.

proxy

   

URL of your proxy in the format <name>:<port>, e. g. --proxy yourproxy:3201

proxy-user

   

Username which is used for authentication against the proxy.

proxy-pw

   

Password which is used for authentication against the proxy.

proxy-pw-base64

   

Same as --proxy-pw, but the password needs to be entered as a Base64 encoded string. Might for passwords with special characters.

verbose

(only used on macOS) 

 

Can be used to enable more detailed logging. Should only be used in cases of error analysis.

 

Examples

Windows

Basic assignment:

TeamViewer.exe assign --api-token 12345678 --group SomeGroup

 Using an alias & grant easy access:

TeamViewer.exe assign --api-token 12345678 --group "Some Group" --devicealias %COMPUTERNAME% --grant-easy-access

 Using a proxy with authentication:

TeamViewer.exe assign --api-token 12345678 --group SomeGroup --reassign --proxy testproxy:3201 --proxy-user someuser --proxy-pw passwd

 

macOS

Examples are for Host version. For the full version just replace TeamViewerHost.app with TeamViewer.app)

 Basic assignment:

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment assign YES -api-token 12345678 -group SomeGroup

 Using an alias & grant easy access:

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment assign YES -api-token 12345678 -group "Some Group" -devicealias %COMPUTERNAME% -grant-easy-access 

 Using a proxy with authentication:

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment assign YES -api-token 12345678 -group SomeGroup -reassign -proxy testproxy:3201 -proxy-user someuser -proxy-pw passwd

 COM API

On Windows the COM API could be used like this:

TeamViewer.exe api <options>

Option Description TeamViewer version

--install

 Install the COM API

>=3

--uninstall

 Uninstall the COM API

>=3

 

How to verify successful installation

Via logfile

Open TV logfile from %appdata%\TeamViewer find following entries:

CommandLineTasks: initializing...

CommandLineTasks: installing COM-API

API: Installing API ...

API: ... successfully installed, calling SignalServiceParamChange ...

API: ... SignalServiceParamChange finished

CommandLineTasks: installing COM-API successful

CommandLineTasks: finished

Via Windows Powershell

Use the following Powershell commands:

$tv = new-object -com TeamViewer.Application
$tv.ApiVersion

Verify that any version will be written in the Windows Powershell for example:

Powershell1.png

How to verify successful un-installation

Via logfile

Open TV logfile from %appdata%\TeamViewer find following entries:

CommandLineTasks: initializing...

CommandLineTasks: uninstalling COM-API

API: Uninstalling API ...

API: ... successfully uninstalled, calling SignalServiceParamChange ...

API: ... SignalServiceParamChange finished

CommandLineTasks: uninstalling COM-API successful

CommandLineTasks: finished

Via Windows Powershell

Use the following Powershell commands:

$tv = new-object -com TeamViewer.Application

Verify that an error will be printed in the Powershell

Powershell2.png

 

Version history
Revision #:
12 of 12
Last update:
‎03 09 2018, 2:44 PM
Updated by:
 
Labels (1)
Contributors