Jump to content

NEED HELP CHAINING


Recommended Posts

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

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").

Link to comment
Share on other sites

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

  • Developers

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...