Skip to content

Instantly share code, notes, and snippets.

@ArthurSchiavom
Created July 14, 2020 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArthurSchiavom/da1ce4e23c6a5017352f63e0a5fb6fc6 to your computer and use it in GitHub Desktop.
Save ArthurSchiavom/da1ce4e23c6a5017352f63e0a5fb6fc6 to your computer and use it in GitHub Desktop.
Kill a process by pressing 2 keys (alt+z)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
ProcessExist(Name){
Process,Exist,%Name%
return Errorlevel
}
proc = YourProcessExecutable.exe
!z::
If ProcessExist(proc)
Process, Close, %proc%
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment