PaulusdeB2 Posted October 7, 2014 Share Posted October 7, 2014 Hi, I'm new to AutoIT. Today I spend a full day trying to built some scripts but I ran into problems controlling windows. Some windows I can control perfectly (controlclick) and others don't respond to anything (i.e. winclose command and/or controlclick). I know how to program them with help of the finder tool. Tried everything. For instance I made a litle script which should uninstall a program called TeamViewer from windows. Here's my script: --- $sBase = "HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall" $iEval = 1 $sSearch = "teamviewer" if ProcessExists("teamviewer.exe") Then ProcessClose("teamviewer.exe") EndIf While 1 $sUninst = "" $sDisplay = "" $sCurrent = RegEnumKey($sBase, $iEval) If @Error Then ExitLoop $sKey = $sBase & $sCurrent $sDisplay = RegRead($sKey, "DisplayName") If StringRegExp($sDisplay, "(?i).*" & $sSearch & ".*") Then $sUninst = RegRead($sKey, "UninstallString") If $sUninst Then Runwait($sUninst) EndIf EndIf $iEval += 1 WEnd ; The above programlines were taken from a samplefile I found on internet. This works fine! controlclick("TeamViewer 9 Uninstall", "&Uninstall", 1); This line gives no response on the activated window... --- When I try different windows of different programmes my programming works fine. I use the Finder Tool to get the data from the window and copy/past the data into the script. I'm using Windows 8.1 on a Intel i7 notebook. Could it be some sort of timing issue ? Thanks in advance! Paul Link to comment Share on other sites More sharing options...
JohnOne Posted October 7, 2014 Share Posted October 7, 2014 Probably trying to interact with an adimin program from a non admin script. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
PaulusdeB2 Posted October 8, 2014 Author Share Posted October 8, 2014 How do I activate admin mode ? Where to begin ? Thanks. Link to comment Share on other sites More sharing options...
PaulusdeB2 Posted October 8, 2014 Author Share Posted October 8, 2014 (edited) How do I activate admin mode ? Where to begin ? Thanks. Sorry, I solved my problems.... Turned out a combination of not using #RequireAdmin AND I always used the control ID number in the controlclick function. I noticed the control ID number was different every with the problemprograms so I tried the [CLASS:Button; INSTANCE:2] instead and this worked !! Thanks a LOT ! Edited October 8, 2014 by PaulusdeB2 Link to comment Share on other sites More sharing options...
Spider001 Posted October 8, 2014 Share Posted October 8, 2014 try to compile to exe 64bit mode Link to comment Share on other sites More sharing options...
Bert Posted October 8, 2014 Share Posted October 8, 2014 Also - see if your app supports command line. IF it does, you can GREATLY simply your scripts as well as make them MUCH more stable. For example teamviewer supports command line: http://www.teamviewer.com/en/help/91-Are-there-parameters-to-start-TeamViewer.aspx The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
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