countscotch Posted June 24, 2014 Share Posted June 24, 2014 (edited) When I choose Run Script the program runs just fine and closes all of the dialog box windows. However, after I compile the script the last two windows do not close. I am not really sure what I may be doing wrong so below is the code:#RequireAdmin ;Used to deal with Windows UAC #include <MsgBoxConstants.au3> ; Script Start - Add your code below here If FileExists(@TempDir & "\ComboFix.exe") Then FileDelete(@TempDir & "\ComboFix.exe") EndIf Sleep(1000) $UrlDownloader = "[url=http://download.bleepingcomputer.com/sUBs/ComboFix.exe]http://download.bleepingcomputer.com/sUBs/ComboFix.exe"[/url] $Directory = @TempDir & "\ComboFix.exe" InetGet($UrlDownloader, $Directory) ;;;ShellExecute(@TempDir & "\ComboFix.exe", "/S") ShellExecute("C:\temp\ComboFix.exe", "/S") Sleep(2000) WinWait("ComboFix", "update ComboFix?", 10) If WinExists("ComboFix", "update ComboFix?") Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix window exists") ControlClick("ComboFix", "update ComboFix?", "[CLASS:Button; INSTANCE:1]") ; click YES button ;Send("{ENTER}") EndIf WinWait("", "ComboFix has detected", 25) If WinExists("", "ComboFix has detected") Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix has detected window exists") ;WinActivate("Warning !!", "ComboFix has detected") ControlClick("Warning !!", "ComboFix has detected", "[CLASS:Button; INSTANCE:1]") EndIf WinWait("", "antivirus:", 10) If WinExists("", "antivirus:") Then ;MsgBox($MB_SYSTEMMODAL, "", "antivirus: window exists") ControlClick("Warning !!", "", "[TEXT:OK]", "left", 1) ;ControlClick("Warning !!", "", "[CLASS:Button; INSTANCE:1]") ;click OK button EndIfAny help with this issues would be greatly appreciated. Edited June 24, 2014 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 countscotch,Welcome to the AutoIt forum. In future when you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jaberwacky Posted June 24, 2014 Share Posted June 24, 2014 I've noticed that the two WinWait's have blank titles whereas the two ControlClicks have "Warning !!" as titles. Could that be the issue? WinWait("", "ComboFix has detected", 25) If WinExists("", "ComboFix has detected") Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix has detected window exists") ;WinActivate("Warning !!", "ComboFix has detected") ControlClick("Warning !!", "ComboFix has detected", "[CLASS:Button; INSTANCE:1]") EndIf WinWait("", "antivirus:", 10) If WinExists("", "antivirus:") Then ;MsgBox($MB_SYSTEMMODAL, "", "antivirus: window exists") ControlClick("Warning !!", "", "[TEXT:OK]", "left", 1) ;ControlClick("Warning !!", "", "[CLASS:Button; INSTANCE:1]") ;click OK button EndIf Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
countscotch Posted June 24, 2014 Author Share Posted June 24, 2014 (edited) I've noticed that the two WinWait's have blank titles whereas the two ControlClicks have "Warning !!" as titles. Could that be the issue? WinWait("", "ComboFix has detected", 25) If WinExists("", "ComboFix has detected") Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix has detected window exists") ;WinActivate("Warning !!", "ComboFix has detected") ControlClick("Warning !!", "ComboFix has detected", "[CLASS:Button; INSTANCE:1]") EndIf WinWait("", "antivirus:", 10) If WinExists("", "antivirus:") Then ;MsgBox($MB_SYSTEMMODAL, "", "antivirus: window exists") ControlClick("Warning !!", "", "[TEXT:OK]", "left", 1) ;ControlClick("Warning !!", "", "[CLASS:Button; INSTANCE:1]") ;click OK button EndIf I have added the blank titles and still the same result. The script will run w/out any errors but after it is compiled it will not close the last two Warning !! windows. WinWait("Warning !!", "ComboFix has detected", 25) If WinExists("Warning !!", "ComboFix has detected") Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix has detected window exists") ;WinActivate("Warning !!", "ComboFix has detected") ControlClick("Warning !!", "ComboFix has detected", "[CLASS:Button; INSTANCE:1]") EndIf WinWait("Warning !!", "antivirus:", 10) If WinExists("Warning !!", "antivirus:") Then ;MsgBox($MB_SYSTEMMODAL, "", "antivirus: window exists") ;WinActivate("Warning !!", "antivirus:") ;give focus to the window ControlClick("Warning !!", "", "[TEXT:OK]", "left", 1) ;ControlClick("Warning !!", "", "[CLASS:Button; INSTANCE:1]") ;click OK button EndIf Edited June 24, 2014 by countscotch Link to comment Share on other sites More sharing options...
Gianni Posted June 24, 2014 Share Posted June 24, 2014 try remove (or increase) timeouts from WinWait() Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
countscotch Posted June 24, 2014 Author Share Posted June 24, 2014 try remove (or increase) timeouts from WinWait() I increased the WinWait timeouts and then the compiled x64 worked but the x86 compile still has the same issue. I really appreciate the responses. Link to comment Share on other sites More sharing options...
Gianni Posted June 24, 2014 Share Posted June 24, 2014 ... what happens if you remove timeouts completely? Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
BrewManNH Posted June 24, 2014 Share Posted June 24, 2014 You're also only waiting 25 seconds and 10 seconds, are you sure that's long enough to wait for the program to run? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
countscotch Posted June 24, 2014 Author Share Posted June 24, 2014 ... what happens if you remove timeouts completely? No dice! Removing the timeouts produced the same results. I am completly stumped. Again, when I debug the script everything appears to be error free. After I complie for the x86 architecture it does not close the last two Warning !! windows. Not sure where the logic in my code is incorrect and/or what else to try. Thanks again! Link to comment Share on other sites More sharing options...
countscotch Posted June 24, 2014 Author Share Posted June 24, 2014 You're also only waiting 25 seconds and 10 seconds, are you sure that's long enough to wait for the program to run? For x86 architecture this part of the script will click install the ComboFix update: If WinWait("ComboFix", "update ComboFix?", 20) Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix window exists") ;If WinWait("ComboFix", "update ComboFix?") Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix window exists") ControlClick("ComboFix", "update ComboFix?", "[CLASS:Button; INSTANCE:1]") ; click YES button ;Send("{ENTER}") EndIf However, even if I remove the timeouts the last two windows still do not close when I compile the script for x86. Here is the code: WinWait("", "ComboFix has detected") ;WinWait("Warning !!", "ComboFix has detected") If WinExists("", "ComboFix has detected") Then ;MsgBox($MB_SYSTEMMODAL, "", "ComboFix has detected window exists") WinActivate("Warning !!", "ComboFix has detected") ControlClick("Warning !!", "ComboFix has detected", "[CLASS:Button; INSTANCE:1]") EndIf WinWait("", "antivirus:") ;WinWait("Warning !!", "antivirus:") If WinExists("", "antivirus:") Then ;MsgBox($MB_SYSTEMMODAL, "", "antivirus: window exists") WinActivate("Warning !!", "antivirus:") ;give focus to the window ControlClick("Warning !!", "", "[TEXT:OK]", "left", 1) ;ControlClick("Warning !!", "", "[CLASS:Button; INSTANCE:1]") ;click OK button EndIf It is my understanding that WinWait would just keep waiting because the Default is 0 (no timeout). Thanks for your response! Link to comment Share on other sites More sharing options...
Gianni Posted June 24, 2014 Share Posted June 24, 2014 just a guess, could perhaps have a sense that if the 2 warnings are fired from a 64-bit executable, then they are not intercepted by your scripts compiled in 32-bit...??? (32bit vs 64bit doesn't work)?? Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... 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