This article applies to TeamViewer customers with a TeamViewer subscription plan


  • Save time on repetitive tasks by automating your scripts. Upload your batch, powershell, or shell scripts encrypted into secure storage within the Management Console.
  • During remote sessions, you can select saved scripts from the menu and start the execution with one click.
  • Standardize maintenance and support while reducing time to resolution.
  • Use your saved time to focus more on important tasks and resolving other support requests.
  • Regain your productivity and help more clients along the way.

OneClick remote script execution - Introduction video

Script upload in the TeamViewer Management Console

All scripts that you want to use within a session need to be uploaded in the TeamViewer Management Console encrypted to a cloud storage.

Please log in with your TeamViewer account to start.

Prerequisites for the TeamViewer Management Console

There are some preconditions, that you must meet, so that you can automate your tasks with scripts. Please make sure that you fulfill them all:

  • For script usage you must have a valid license for TeamViewer 14.
  • Scripts are ready to use and saved on your local or network folders in a file.
  • The script file size is less than 100 kB.

Upload process in the TeamViewer Management Console

You can administer your scripts in the Management Console by clicking the Scripts menu item under Home in the upper left corner.. 


If you are new to using scripts, you can just start adding a script from the information page with the Add script button.  Script2.pngIf you have already uploaded some scripts, they will be displayed in a table. 



The Add script button at the top of the table provides a new menu to add some information about the script and to select a script file. 




Name and description

You can add a short name and a longer meaningful description for your script. The name will be used for the menu within the session, while the description will be shown as a tooltip for a script menu entry, so that you can provide some information about what the script does.

If you do not add any name, the script name (without the file ending) will be taken as default on file selection.

Operating system

By choosing the operating system you will be shown only those scripts within the menu in your sessions, that can be executed on the remote machine operating system you are connected to.

Windows and macOS are supported currently.

Run as administrator

If your script uses at least one command, that needs administrative rights (elevated mode on Windows), you should check the Run as administrator execution.

When you start a script, you are asked only once before the start of the execution for permission (if the logged in user already has administrative rights) or for administrator credentials (if the logged in user has no admin rights) regardless of how often or when such commands are used within your script (e.g. for long running tasks).

(warning) Currently you are only able to execute scripts as administrator on an installed TeamViewer. On Windows "Run only (one time use)" option or QuickSupport it is not possible, because the UAC prompt cannot be displayed on the client side. 

Script types

The following script types are currently supported

  • On Windows
    • Batch (.bat, .cmd)
    • Powershell (.ps1)
  • On macOS
    • Shell (.sh)


If you click the Save button, your script file is uploaded encrypted to the cloud storage. Your script data and the link to your script file are also stored encrypted.


You can modify and delete existing scripts by selecting the Edit or Delete function within the context menu for a script item. The context menu is shown if you hover over with the mouse at the end of the table: Script5.PNG

If you modify an already existing script file or the script data, the changed file or data is saved instead of the old data. The old script file is deleted from the cloud storage.

Script execution within your sessions

If you start a TeamViewer session, you will have access to your scripts within a new script menu.


There are some prerequisites, that you must meet, before you can automate your tasks with scripts. Please make sure that you fulfill them all:

  • For script usage you must have a valid license for TeamViewer 14.
  • The remote system you are connected to must have TeamViewer version 14.
  • You must be logged in the TeamViewer client with your licensed account (otherwise your scripts will not be displayed for the session).
  • The scripts, you want to run on the remote machine, must be marked as suitable for the remote machine operating system.
  • For Windows: The TeamViewer client on the remote side must be installed (not started with "Run only"). Otherwise, when running scripts that require administrative rights, the UAC prompt cannot be visible to the connecting client.
  • An HTTP connection from the remote system to the cloud storage must be possible.

Script execution

  • Establish a TeamViewer connection after the prerequisites listed above have been met.
  • Open the scripts menu.
    • Windows: In the client toolbar go to Actions and click the Scripts button to open the menu.Script6.png


    • macOS: In the menu bar go to Scripts.script7.png


  • All your uploaded scripts for your remote machine operating system will be shown in the displayed menu.
  • Select a script to run on the remote machine by clicking on the context menu.
  • Once per session: the remote user must accept the script execution request dialogue.
  • The script is downloaded to the remote machine from the cloud storage, decrypted and started.
  • If the script needs administrative rights, a dialogue will pop up to ask for permission.
  • On the remote side some notifications are shown for the current status.

Permission handling (especially for unattended devices)

Scripts can only be executed if the user on the remote side accepts the execution request once per session. For unattended devices there is no user, who can acknowledge the request.

For this you have the possibility in the options / preferences to disable the request dialogue for this TeamViewer installation.


On Windows open the TeamViewer client and go to Extras --> Options in the menu. Select the Advanced tab and scroll down to the section Advanced settings for connections to this computer



On macOS open the TeamViewer client and go to the Preferences in the menu. Select the Advanced tab and scroll down to the section Advanced settings for connections to this computer.

Check the new setting Allow script execution without confirmation and exit with Apply


Scripts are not available within a session

If you cannot run scripts within a session for some reason, the script menu is shown but is disabled. If you hover over with your mouse, you will find the reason for it in the tooltip that appears.


Check the new setting Allow script execution without confirmation and exit with OK






Tips for writing your scripts

Using '~' for paths on macOS

On macOS you can use ‘~’ to address the user's home directory. If scripts are executed with administrative rights, the script is executed by the root user. Therefore, ‘~’ will be replaced by /var/root and not with the home directory of the logged in user.

Furthermore, the $HOME variable is not set in this case. For these reasons, you should not rely on ‘~’ and $HOME if you run your scripts as administrator.

If you need to create, copy or download folders or files, you can use the working directory of the executed script which is located under ~/Library/Application Support/TeamViewer/Remote Scripting/<script-uuid>.

This directory will be deleted right after the executed script has terminated.

These files and folders are also created by the root user. If necessary you can change the owner with the chown command and change the rights with chmod.


Why is my Powershell script not executed on the remote machine but works fine locally?

    • On Windows the execution of Powershell scripts is restricted per default. You have to change the  Execution Policy first.
    • For further details, please have a look at the documentation for Get-ExecutionPolicy and Set-ExecutionPolicy 




Version history
Revision #:
6 of 6
Last update:
‎08 Jan 2019, 4:10 PM
Updated by: