viper1000 Posted June 18, 2010 Share Posted June 18, 2010 (edited) OS: VISTA Enterprise SP2AutoIt: 3.3.6.1Test Script: (exit.exe)MsgBox(0, "","Test",2) Exit 2Situation:Using AutoIt generated EXE inside of a Batch routine always return the correct ReturnCode.Starting AutoIt generated EXE from a another program may NOT return the expected ReturnCode !Test:If I execute my exit.exe in a DOS shell @echo %errorlevel% returns 0 instead of 2 If I execute cmd /c exit.exe in a DOS shell @echo %errorlevel% returns 2 If I execute start /w /c exit.exe in a DOS shell @echo %errorlevel% returns 2 Questions:Has anyone a explanation on this behaviour ?Is there another possibility to receive the expected return Code without prefix cmd /c, start /w OR using a batch? Edited June 18, 2010 by viper1000 Link to comment Share on other sites More sharing options...
JFX Posted June 18, 2010 Share Posted June 18, 2010 If you don't wait for a program to finish, how do you want to get the exit code?In your first example your DOS Shell will not wait til the exit.exe exit.You may compile as CUI if you don't want to use start /w or /c Link to comment Share on other sites More sharing options...
viper1000 Posted June 21, 2010 Author Share Posted June 21, 2010 (edited) If you don't wait for a program to finish, how do you want to get the exit code?In your first example your DOS Shell will not wait til the exit.exe exit.You may compile as CUI if you don't want to use start /w or /cThanks a lot for your hint. Using CUI is what I needed !! Edited June 21, 2010 by viper1000 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