Set a keyboard shortcut for a Windows CMD command?
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 videos on Youtube
mxrclxst
Updated on September 18, 2022Comments
-
mxrclxst over 1 year
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.
(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?
-
ssnobody over 9 yearsAutohotkey can do it, but its more complicated than your current solution.
-
-
Jonathan over 7 yearsDoes this work on Windows 10? I just tried and it didn't work?
-
Scott Rhee over 7 years@Jonathan // Try these - 1. Windows 10 has more reserved shortcut keys ever that you can't use for this. So try again with another combination. Test it before making the shortcut hidden. 2. Create a batch file to do the same thing, confirm that it works and then create a shortcut to that batch file to ensure that your taskkill syntax is correct.