zzen11 Posted May 10, 2005 Share Posted May 10, 2005 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 Link to comment Share on other sites More sharing options...
Ejoc Posted May 10, 2005 Share Posted May 10, 2005 $errorcode = RunWait("program.exe") It's in the help file. 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 More sharing options...
zzen11 Posted May 10, 2005 Author Share Posted May 10, 2005 (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 May 10, 2005 by zzen11 Link to comment Share on other sites More sharing options...
MHz Posted May 10, 2005 Share Posted May 10, 2005 If program.exe ran correctly, $errorcode should be 0, in Ejocs example. Link to comment Share on other sites More sharing options...
zzen11 Posted May 10, 2005 Author Share Posted May 10, 2005 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 More sharing options...
Ejoc Posted May 10, 2005 Share Posted May 10, 2005 (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 May 10, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now