Windows – Set a keyboard shortcut for a Windows CMD command

cmd.execommand linekeyboard shortcutswindows 8.1

I'm running Windows 8.1 Pro and would like to know if it's possible to have a keyboard shortcut to run

taskkill /F /FI "STATUS eq NOT RESPONDING"

using "CTRL + ALT + X"

SIDE NOTE:
I have currently have a work-around where I have a batch file (KillTask.bat) with the command and a desktop shortcut to KillTask.bat with the shortcut key set to CTRL+ALT+X.

Screenshot
(Here's a screen-shot explaining the work-around)

Is there a more direct method of doing this by way of a keyboard shortcut without the use of desktop shortcuts and batch file?

Best Answer

You don't have to write a batch file. Just create a shortcut of taskkill.exe on desktop and modify the shortcut to have the arguments you use on "Target" field. If you want to be cooler, change the attribute of that shortcut to "hidden" and the keyboard shortcut will still work. Just don't forget that you made this hidden shortcut; or you'll be in trouble when you want to remove that keyboard shortcut. I've been using this way on Windows 7 and I believe that this is still valid on Win8.

To make that hidden shortcut visible again, you may use command prompt + "attribute -R" command, or change the folder option on Windows Explorer.

Related Question