The AutoIt WinKill function is used to forcibly close a window. A potential disadvantage is that the user wont be able to respond to prompts to save unsaved work, and as such they might lose their work.
If you want to close a window normally, and allow the window or program time to close - as well as display possible save dialogs - you should consider using WinClose instead
|Title||The title of the window.|
|Text||The text of the window.|
Run("notepad.exe") $hWnd = WinWait("[CLASS:Notepad]", "", 10) ; Wait a couple of seconds before closing the window Sleep(2000) ; Closes the window WinKill($hWnd, "")