lte5000 Posted October 9, 2004 Share Posted October 9, 2004 (edited) I run this from a CMD window on WinXP SP2:"%ProgramFiles%\autoit3\autoit3.exe" /c "Exit 1"Then I run this:echo %errorlevel%This echos a 0, shouldn't it echo 1?Or am I doing something wrong?KendallEdit: Typo. Edited October 9, 2004 by lte5000 Link to comment Share on other sites More sharing options...
CyberSlug Posted October 9, 2004 Share Posted October 9, 2004 Put the following in a batch file: REM someFile.bat @echo off "%ProgramFiles%\autoit3\autoit3.exe" /c "Exit 1" echo Error code is %errorlevel% pause AutoIt appears to work fine. I think it's a feature of the command prompt that %errorlevel% gets reset when a a non-batch command finished executing.... or something like that. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 9, 2004 Share Posted October 9, 2004 *Off-topic* Cyberslug, do you know anything about the Virginia Kentucky resolution in 1789 I think? I'm doing a report on it, since you're from Kentucky you might know! PM me if you know anything. Link to comment Share on other sites More sharing options...
lte5000 Posted October 9, 2004 Author Share Posted October 9, 2004 I run this from a CMD window on WinXP SP2:"%ProgramFiles%\autoit3\autoit3.exe" /c "Exit 1"Then I run this:echo %errorlevel%This echos a 0, shouldn't it echo 1?Or am I doing something wrong?KendallEdit: Typo.<{POST_SNAPBACK}>Works!Thanks CS. Link to comment Share on other sites More sharing options...
simeon Posted October 19, 2005 Share Posted October 19, 2005 Please add this at the top of the FAQ What a crazy behaviour! Simeon Link to comment Share on other sites More sharing options...
Skruge Posted October 19, 2005 Share Posted October 19, 2005 AutoIt appears to work fine. I think it's a feature of the command prompt that %errorlevel% gets reset when a a non-batch command finished executing.... or something like that. Correct me if I'm wrong, but Autoit3.exe is a GUI program, therefore the error code isn't passed back to the command interpreter unless you explicitly wait for it. Try: start /wait "" "%programfiles%\autoit3\autoit3.exe" /c "Exit 12345"It should work outside of a batch file. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] 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