Jump to content

AutoIt3 /c "Exit"


Recommended Posts

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?

Kendall

Edit: Typo.

Edited by lte5000
Link to comment
Share on other sites

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

Guest BL@(K-R34P3R

*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

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?

Kendall

Edit: Typo.

<{POST_SNAPBACK}>

Works!

Thanks CS.

Link to comment
Share on other sites

  • 1 year later...

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

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...