In autoit.de a user said that if the script was closed from the tray, something lingered and did not close the process. This was the example he gave: #include <Array.au3> Local $a[1] _ArrayDisplay($a) Looked into it and this is the fix I propose: ... Local $hGUI = GUICreate(... GUICtrlCreateLabel("@ArrayDisplayInternals@GUIidentifier@", 0, -10, 0, 0) ... ; Switch to GetMessage mode Local $iOnEventMode = Opt("GUIOnEventMode", 0), $aMsg