Terminates a named process.
||The name or PID of the process to terminate.
||Returns 0 and set @error to:
||1 = OpenProcess failed
||2 = AdjustTokenPrivileges Failed
||3 = TerminateProcess Failed
||4 = Cannot verify if process exists
Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"
If multiple processes have the same name, the one with the highest PID is terminated--regardless of how recently the process was spawned.
PID is the unique number which identifies a Process. A PID can be obtained through the ProcessExists or Run commands.
The process is polled approximately every 250 milliseconds.
ProcessExists, ProcessWait, ProcessWaitClose, Run, WinClose, ProcessList, RunAs, Shutdown, WinKill
Local $PID = ProcessExists("notepad.exe") ; Will return the PID or 0 if the process isn't found.
If $PID Then ProcessClose($PID)