GSW Posted May 4, 2011 Share Posted May 4, 2011 Hi ... I'm an absolute noob at this, but I learn pretty quickly once I'm pointed in the right direction. I can't understand why i can't get 2 routines to run consecutively even though I can run them singly. This runs standalone: Run("01-KillAps\kill.bat") ; kill unnecessary services excluding autoit WinWaitActive("Open File - Security Warning") ; wait for messagebox to appear Send("!R") ; OK to run and this runs standalone: Run("02-DesktopOK\DesktopOK.exe") WinWaitActive("DesktopOK 2.35 Free") Send("!d") ; 0pens the Desktop Ok drop menu Send("{ENTER}") ; Saves the desktop Send("!x") ;exit the program but this hangs after the first routine, even with a sleep between them: ; routine #1: Deactivate unnecessary services that are running. Run("01-KillAps\kill.bat") WinWaitActive("Open File - Security Warning") Send("!R") ; routine #2: Preserve desktop for later recovery. Run("02-DesktopOK\DesktopOK.exe") WinWaitActive("DesktopOK 2.35 Free") Send("!d") ; 0pens the Desktop Ok drop menu Send("{ENTER}") ; Saves the desktop Send("!x") ;exit the program exit The kill.bat program kills running services but specifically excludes autoit. Any ideas about why the routine should hang? Link to comment Share on other sites More sharing options...
jaberwacky Posted May 4, 2011 Share Posted May 4, 2011 The only thing I can think of is that when you run kill.bat, it's still running while you're trying to run DesktopOK.exe. If this is the case then try turning Run("01-KillAps\kill.bat") into RunWait("01-KillAps\kill.bat"). 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...
GSW Posted May 4, 2011 Author Share Posted May 4, 2011 The only thing I can think of is that when you run kill.bat, it's still running while you're trying to run DesktopOK.exe. If this is the case then try turning Run("01-KillAps\kill.bat") into RunWait("01-KillAps\kill.bat").Mmm ... already tried that one, didn't work though (the second routine, that is). I also tried RunWait(@ComSpec & " /c " & "01-KillAps\kill.bat"), but that didn't help either.The DOS window closes, but I don't really know if the routine has ceased running or not.Any other ideas folks? Link to comment Share on other sites More sharing options...
Developers Jos Posted May 4, 2011 Developers Share Posted May 4, 2011 add this to the top of the script: Opt("TrayIconDebug", 1) and hover over the autoit3 trayicon to see what line it "hanging" on. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GSW Posted May 5, 2011 Author Share Posted May 5, 2011 add this to the top of the script:Opt("TrayIconDebug", 1)and hover over the autoit3 trayicon to see what line it "hanging" on.Thanks Jos ...I'll give it a try. Link to comment Share on other sites More sharing options...
GSW Posted May 5, 2011 Author Share Posted May 5, 2011 Brilliant !! Thanx all, once I could see the hang, I was able to fix it. Problem solved. 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