Jump to content

winwaitclose and running apps sequencially


Guest MikeyBM
 Share

Recommended Posts

Guest MikeyBM

Have a a database whereby we have to run 4 maintenance commans daily. First of all we used scheduled tasks but this failed. Looking into why these tasks failed it became apparent that the 2nd and 3rd tasks were starting while task1 was still running.

I created a batch file that used the start /wait command so that each maintenance command would run and only when the command had terminated would the next one start up.

This failed also. Something to do with batching and our application.

I new that AutoIT had the WinWaitActive and WinWaitClose commands which I likes so I thought I would give this a try instead.

Here is how the test script looks

; Run rdp

Run ("C:\WINDOWS\system32\mstsc.exe")

; Wait for RDP become active

WinWaitActive("Remote Desktop Connection")

; Now that RDP window is active type some text

Send("IP Address Here")

; Now wait for RDP to close before continuing

WinWaitClose("Remote Desktop Connection")

; Run the next application in the sequence

Run ("c:\test.bat")

; Finished!

Now the RDP client comes up great and even the IP address is populated. However when I close the MSTSC.exe application the next application does not start up and the script appears to terminate.

Could someone give me some pointers as to what is happening and how I can sequentially run these apps?

Thanks

Mike

Link to comment
Share on other sites

Guest MikeyBM

RunWait() will not continue your script until the program has finished executing.

So if RunWait() will not continue my script then this is a command that I shouldnt be using, right? I want something that will continue until each application has run

Link to comment
Share on other sites

Guest MikeyBM

Im just being a smart ass. I think that will do it. I will give it a try. I will let you know

This didnt work unfortunately (the script works well but now with our database) I get the same error as with the batch file "API Library is not found"

The only way I can run the command is from Start and Run prompt. The command is as follows "D:\Data\Maxwin\maximum.exe STATCALC"

What commands can I use to access start and run?

Thanks

M.

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