I need to make a global shortcut to kill a process with known name. E.g. in GNU/Linux you can do it using xbindkeys to bind "killall firefox" to Ctrl+Alt+K. I need to kill, not terminate a process, so it doesn't get a chance to process the signal.
1 Answer
This can be done with a *.bat file and Windows' built in hotkeys:
In Notepad, type in:
taskkill /f /im nameOfProcessToKill.exeFor example:
taskkill /f /im notepad.exeSave this as a .bat file:
For example:
killNotepad.batCreate a shortcut to the .bat file in a location you intend to keep it. If the shortcut is moved later, the hotkey will no longer work.
Right-click this shortcut and choose "Properties".
In the "Properties" window, select the "Shortcut" tab. In the text box labeled "Shortcut Key" enter whatever key you would like to use. Windows will automatically add Ctrl + Alt in front of it.
Example: Typing K will create the shortcut Ctrl + Alt + K
Click Apply/OK and then test out the new hotkey.