Jump to content

Synchronous script execution


Recommended Posts

Hi all,

I have a autoit script that is called from a windows batch file and I would like the batch file to wait till the script has finished executing. The script (even compiled) seems to exit immediately and run asynchronously. Is there a way to compile the script so it executes synchronously? I found an old post that suggested using the windows start command e.g

start /wait /b compiledscript.exe scriptparameters

However this does not work as it is waiting for an asynchronous exe to run so returns immediately. I guess I could rewrite the windows batch file as an autoit script and use the RunWait or ProccessWaitClose... but then my batch file will be asynchronous. Chicken and egg :)

Any thoughts?

Link to comment
Share on other sites

Hi all,

I have a autoit script that is called from a windows batch file and I would like the batch file to wait till the script has finished executing. The script (even compiled) seems to exit immediately and run asynchronously. Is there a way to compile the script so it executes synchronously? I found an old post that suggested using the windows start command e.g

start /wait /b compiledscript.exe scriptparameters

However this does not work as it is waiting for an asynchronous exe to run so returns immediately. I guess I could rewrite the windows batch file as an autoit script and use the RunWait or ProccessWaitClose... but then my batch file will be asynchronous. Chicken and egg :)

Any thoughts?

Introduce this, ShellExecuteWait()

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