By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

AutoIt Exit Keyword

Explains simple use – Reference on the AutoIt Exit Keyword.

Edited: 2012-05-11 06:09

The AutoIt Exit Keyword is used to terminate the running script, optionally returning 1 on failure.

You can create a custom exit function by including the exit keyword inside a function, and then bind the function to a hotkey.


Return codeCan be used by Windows – the default return code is 0, use 1 to indicate to windows that the script did not execute properly.

AutoIt Exit Examples

Well, just include it anywhere you'd like in your script – or call it with a function.

MsgBox(0, "AutoIt Exit example:", "The Script will now quit, not showing the next message.")
MsgBox(0, "AutoIt Exit example:", "This Box will not be shown.")

See also

  1. AutoIt Exit Function