Terminates a named process.
ProcessClose ( "process")
Parameters
| process | The name or PID of the process to terminate. |
Return Value
| Success: | Returns 1. |
| Failure: | Returns 0 and set @error to: |
| 1 = OpenProcess failed | |
| 2 = AdjustTokenPrivileges Failed | |
| 3 = TerminateProcess Failed | |
| 4 = Cannot verify if process exists |
Remarks
Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"
Related
ProcessExists, ProcessWait, ProcessWaitClose, Run, WinClose, ProcessList, RunAs, Shutdown, WinKill
Example
ProcessClose("notepad.exe")
$PID = ProcessExists("notepad.exe") ; Will return the PID or 0 if the process isn't found.
If $PID Then ProcessClose($PID)