Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
A specific example would be helpful. – uSlackr Mar 14 '12 at 13:31
A 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. – Corporate Geek Mar 14 '12 at 19:41
As 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 than file -> start menu and win-key -> start menu separately. Maybe it's not practical in your case, but you can consider it. – Gauthier Mar 17 '12 at 0:11
up vote 1 down vote accepted

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.

share|improve this answer
This is good info. Thanks. Plus, it has the advantage of not requiring to use a third-party tool. – Corporate Geek Mar 14 '12 at 19:38
What is the code for the Windows key? – Corporate Geek Mar 14 '12 at 19:52
@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. – xdumaine Mar 15 '12 at 3:10
You 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}" – Corporate Geek Mar 15 '12 at 9:14
Thanks for pointing me in the right direction though. – Corporate Geek Mar 15 '12 at 9:14

How do you bind your shortcuts today? I would recommend autohotkey. Create a shortcut file on the desktop (or a batch, or whatever), and bind the desired keyboard shortcut to c:\path\to\you\desktop\file-to-execute.

Autohotkey allows you to create both shortcuts that are application specific (for example binding Ctrl+V to paste in command prompts), or generic whatever the currently selected application.

I have Ctrl+Alt+N associated with Notepad, I guess nothing prevents you from associating with a file on your desktop.

share|improve this answer
I 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. – xdumaine Mar 14 '12 at 14:17
I 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 Mar 14 '12 at 14:34
and as the comment says, an example would clarify greatly. – Gauthier Mar 14 '12 at 14:35

We've used AutoIt whenever we've need to push keystrokes into an automated process. It would work well for this as would the other solutions here.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .