Sign in to follow this  
Followers 0
bistrader

String au3 files together?

5 posts in this topic

I have 5 au3 files (Step 1 thru Step 5) that need to be run one after the other and I need to run all 5 each night.

I would like to run them automatically one after the other. So, I decided to create a Total.au3 which is the following. I thought AutoIt would run the first one and not do the others until the first one is done. Then, run the second one and not touch the others until done. Etc. Nope. It tries to run all at the same time. I guess I could time each event and place sleep commands in between each run. How do others handle?

; This is Total.au3

RunWait(@ComSpec & " /c start " & "Step1.au3", "C:\AutoIt_Work\Steps\", @SW_HIDE)

RunWait(@ComSpec & " /c start " & "Step2.au3", "C:\AutoIt_Work\Steps\", @SW_HIDE)

RunWait(@ComSpec & " /c start " & "Step3.au3", "C:\AutoIt_Work\Steps\", @SW_HIDE)

RunWait(@ComSpec & " /c start " & "Step4.au3", "C:\AutoIt_Work\Steps\", @SW_HIDE)

RunWait(@ComSpec & " /c start " & "Step5.au3", "C:\AutoIt_Work\Steps\", @SW_HIDE)

; The End

....

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

just a guess but wouldn't it be start /w

no it wouldn't work either i don't think

just run in a batch with start /w

start /w C:\AutoIt_Work\Steps\Step1.au3

start /w C:\AutoIt_Work\Steps\Step2.au3

etc..

Edited by CWorks

Share this post


Link to post
Share on other sites

I suppose your scripts displays screens ...

If yes, check the autoit help file for commands like WINWAITxxx :whistle:


Logicae Homo EstFemina Homo EstFemina Logicae Est

Share this post


Link to post
Share on other sites

Try this:

$File = @HomeDrive & '\AutoIt_Work\Steps\Step'
For $i = 1 To 5
    RunWait(@AutoItExe & ' /AutoIt3ExecuteScript ' & FileGetShortName($File & $i & '.au3'))
Next


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thanks. I will try each. I already tried WinWait stuff but it did not work. I am guessing that placing start w/ over and over again in AllSteps.bat might work. This is what I understand Cworks to be saying. And, I like SmOke N's loop approach. Gee, where do you guys come up with these names. Never mind. Thanks again for the help.

Share this post


Link to post
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
Sign in to follow this  
Followers 0