I use the Win+R combination to run almost all the applications I use. Hit Win+R, type firefox, and Firefox runs. Hit Win+R, type winword, and Word starts. Hit Win+R…, well you get the idea.
The Run dialog is great to quickly access applications you use, but it’s only usable for programs that put their folder in the PATH environment variable, which not all programs do. I’ve been adding programs I liked to the PATH for years when a friend of mine showed me a neat trick. You create a folder called Shortcuts somewhere (say C:\Shortcuts) and put it at the start of your PATH environment variable and then create shortcuts to your favorite programs in that folder. All those shortcuts are now available to you via using Win+R. A nice bonus is the fact that you can name the shortcuts any way you like. I usually have a www.lnk file pointing to Firefox, note.lnk pointing to Notepad and word.lnk pointing to Word.
There’s only one thing missing here to make this trick into an fully featured program launcher. We need a way to quickly create shortcuts to programs, preferably by right-clicking on them in Windows Explorer. You can do that without installing anything using a couple of obscure Windows features – the Send To menu in the right-click menu of each file and the fact that Windows can run *.vbs files with VBScript code in it using something called WSH.
Here’s the source of a script that creates a link to whichever was passed to it in the command line (executable, folder, etc.).
If WScript.Arguments.Count < 1 Then
‘ create shorcut name
commandPath = WScript.Arguments(0)
dot = InStrRev(commandPath, ".")
If dot = 0 Then dot = Len(commandPath)
slash = InStrRev(commandPath, "\")
If slash = 0 Then slash = 1
commandDir = Mid(commandPath, 1, slash-1)
shortcutName = Mid(commandPath, slash+1, dot-slash-1)
‘ ask for shortcut name
shortcutName = InputBox("Enter shortcut name", "Shortcut", shortcutName)
‘ create shortcut
shortcutPath = SHORTCUTS_PATH & "\" & shortcutName & ".lnk"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oShellLink = WshShell.CreateShortcut(shortcutPath)
oShellLink.TargetPath = commandPath
oShellLink.WindowStyle = 1
oShellLink.IconLocation = commandPath & ", 0"
oShellLink.WorkingDirectory = commandDir
The Send To menu is actually a folder located at C:\Documents and Settings\<YourUser>\SendTo. This folder contains links to various programs and you can add shortcuts to your own programs there. When you right-click a file, and choose one of the Send To items, the corresponding program is called, and given the name of the file you right-clicked as a command line parameter. So, if you put a link to the script above in the Send To folder, you’ll be able to easily create links in the C:\Shortcuts folder.
In case you lost me somewhere along the way, and in case I ever need to set this up myself again, here are the instructions to set things up:
- Create C:\Shortcuts
- Create C:\Shortcuts\create_shortcut.vbs and paste the above code into it.
- Add C:\Shortcuts to the start of your PATH environment variable (Win+Pause > Advanced > Environment Variables).
- Hit Win+R, type sendto, hit Enter. That should get you to your Send To folder.
- Create a shortcut here to C:\Shortcuts\create_shortcut.vbs and call it Shortcuts.
To add a program to the launcher:
- Right click a program or a folder (you can do it even on programs in your Start Menu).
- Send To > Shortcuts.
- In the dialog change the shortcut name to something short and catchy.
- Test it : Hit Win+R, type the shortcut name and hit Enter.