Sign in to follow this  
Followers 0
mellopete

Team Viewer Script

7 posts in this topic

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

Share this post


Link to post
Share on other sites



Have a look here:

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Thanks UEZ. However it doesn't close the window for me. Just to be clear, this is for the remote side. When I remote in with TV it leaves the nag and window open on the remote computer once I disconnect.

Share this post


Link to post
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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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:

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

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0