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 code||Can 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.") Exit MsgBox(0, "AutoIt Exit example:", "This Box will not be shown.")