Jump to content

retrieve the return code of the program


zzen11
 Share

Recommended Posts

$errorcode = RunWait("program.exe")

It's in the help file.

<{POST_SNAPBACK}>

Well, the return value here from RunWait() is about RunWait() call, not the return value by the "program.exe". Edited by zzen11
Link to comment
Share on other sites

If program.exe ran correctly, $errorcode should be 0, in Ejocs example.

<{POST_SNAPBACK}>

The problem I try to solve is that the program.exe can return different values when it quits. I want to get those values.
Link to comment
Share on other sites

I made an example for you, just compile the first two into executables.

return1.au3:

exit(1)

return2.au3:

exit(2)

errorcode.au3:

$ret = runwait("return1.exe")
msgbox(0,"",$ret)

$ret = runwait("return2.exe")
msgbox(0,"",$ret)
Edited by Ejoc
Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
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...