Jump to content

Recommended Posts

Posted

How do I retrieve the return code of a program. For example, I can use the RunWait("program.exe"). how do I retrieve the return code generated by the program.exe (like errorlevel)?

Z

Posted (edited)

$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
Posted

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.
Posted (edited)

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

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
  • Recently Browsing   0 members

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