How to turn a keyboard shortcut into a Desktop shortcut?
5,285
You could use a VBS script to do this with sendkeys.
Create a text file with a .vbs
extension, and create a WScript Shell object, then use sendkeys. I just tried this with ctrl-shift-escape to open task manager:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^+{ESCAPE}"
Found the info here.
Comments
-
keling over 1 year
Here is my dilemma:
I use several keyboard shortcuts to be more productive and get faster access to certain things in Windows. But... is there a way to translate those keyboard combinations into a shortcut file that can be placed on the desktop and run with the mouse? I am referring only to keyboard shortcuts that can be used to get around Windows, not shortcuts for specific applications.
This will be very useful to other users who are not that into keyboard shortcuts.
-
uSlackr about 12 yearsA specific example would be helpful.
-
keling about 12 yearsA very simple example is the Windows key on the keyboard, which opens the Start Menu. Or Control + C. How do you translate such keyboard shortcuts into a shortcut file.
-
Gauthier about 12 yearsAs I understand it, you want several ways to perform one single action. Rather than making the file trigger the shortcut, that then triggers the action, I find it more logical to have both the file and the shortcut perform the action directly.
file -> win-key -> start menu
seems less logical thanfile -> start menu
andwin-key -> start menu
separately. Maybe it's not practical in your case, but you can consider it.
-
-
xdumaine about 12 yearsI think you have it backwards. I interpreted his question has how to have a shortcut file trigger a keyboard shortcut, but your answer is how to have a keyboard shortcut trigger a shortcut file. Note how he's trying to not have to use keyboard shortcuts, as he says it'd be useful for those who are not that into keyboard shortcuts.
-
Gauthier about 12 yearsI automatically interpreted that the keyboard shorcuts in question were custom ones. The result of my answer is a desktop file doing whatever OP wants, and a keyboard shortcut to trigger that file. That way he can continue to use his (assumingly custom) shortcut, while mouse-trapped users can use the shortcut. Everyone is happy. But I see your point. If OP wants a way to e.g. open the system settings with win+pause, I would say that the correct way is not to have a desktop file trigger win+pause, but to have the file open the system settings itself.
-
Gauthier about 12 yearsand as the comment says, an example would clarify greatly.
-
keling about 12 yearsThis is good info. Thanks. Plus, it has the advantage of not requiring to use a third-party tool.
-
keling about 12 yearsWhat is the code for the Windows key?
-
xdumaine about 12 years@CorporateGeek I was trying to find that actually. The closest I could find was ctrl-escape, but that doesn't work for windows key combinations, it just opens the start menu. I'll keep looking, but you should post back here if you find it.
-
keling about 12 yearsYou code sample was returning an error. Something with expected end of line missing. I found another approach which worked. Option Explicit Dim objShell : Set objShell = CreateObject("WScript.Shell") objShell.SendKeys "^{esc}"
-
keling about 12 yearsThanks for pointing me in the right direction though.