Jump to content

Team Viewer Script


Recommended Posts

Hello Everyone,

My name is Pete. I am new to this forum, and to scripting. I am trying to use AutoIt to close the TeamViewer nag screen, then minimize the TeamViewer window on the remote machine upon disconnect. I found the script here. I replaced WinClose("TeamViewer") with WinSetState("TeamViewer", @SW_MINIMIZE, 0), because WinClose causes problems. Now, here is where I need help. The nag screen doesn't show up every time. I would like to check if nag screen exists, if so close it, then minimize the TV window. Also, I wouldn't mind having the script run once instead of a loop, and run it each time I disconnect. Or... even better have the script disconnect TV, close the nag, minimize TV, then end itself.

Local $nagHandle = 0
while True
$nagHandle = WinWait("Sponsored session")
if Not ($nagHandle = 0) Then
     WinActivate ("Sponsored session")
     sleep(3)
     Send("{Enter}")
WinSetState("TeamViewer", @SW_MINIMIZE, 0)
EndIf
WEnd
Link to comment
Share on other sites

Yes, the script has to run on the remote system. It is not easy to rebuild the infrastructure to test TV.

Be creative and modify the script appropriately.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 months later...

This is how I do it. Maybe it won't work with recent versions of TV but still worth a try.

I use WinExists since this is not a dedicated anti-nag script (winwait in my case will hang execution). Adapt to your situation as needed

if WinExists("Sponsored session") Then
ControlClick("Sponsored session","","[CLASS:Button; INSTANCE:4]")
EndIf
Edited by AndyScull
Link to comment
Share on other sites

  • 1 year later...

I just switched to TeamViewer9 since LogMeIn Free will be gone very soon.

I do not get the TeamViewer window open after disconnecting (might be due to an automatically minimize TeamViewer option in advanced settings), however I was getting the stupid nag prompt.

This is the script I use:

Local $tvHandle = 0
#NoTrayIcon
while True
   $tvHandle = WinWait("Sponsored session")
   if Not ($tvHandle = 0) Then
      WinActivate ("Sponsored session")
      sleep(20)
      Send("{Space}")
   EndIf
   sleep(100)
WEnd

Change sleep to your preference. It works great on an "old" win7 x64 AMD laptop I tested it on, mostly using 0% CPU and sometimes flickers 1%.

I also added it to start automatically under HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun

Link to comment
Share on other sites

I just switched to TeamViewer9 since LogMeIn Free will be gone very soon.

I do not get the TeamViewer window open after disconnecting (might be due to an automatically minimize TeamViewer option in advanced settings), however I was getting the stupid nag prompt.

This is the script I use:

Change sleep to your preference. It works great on an "old" win7 x64 AMD laptop I tested it on, mostly using 0% CPU and sometimes flickers 1%.

I also added it to start automatically under HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun

 

I recommend to use ControlSend, since simple Send can sometimes bug your SHIFT button.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...