mellopete Posted August 20, 2012 Posted August 20, 2012 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
UEZ Posted August 20, 2012 Posted August 20, 2012 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
mellopete Posted August 20, 2012 Author Posted August 20, 2012 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.
UEZ Posted August 21, 2012 Posted August 21, 2012 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
AndyScull Posted October 30, 2012 Posted October 30, 2012 (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 October 30, 2012 by AndyScull
thehasty Posted January 22, 2014 Posted January 22, 2014 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
Unc3nZureD Posted January 22, 2014 Posted January 22, 2014 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now