Thursday, October 1, 2009

How to create custom Run commands in Windows

If you’ve ever used the Run command box in Windows, you probably know you can type certain predefined commands to open programs, etc. For example, if you type “notepad” in the Run box, it’ll open Notepad in Windows.If you type “cmd” in the Run box, it opens the command prompt. If you type “regedit”, it open the registry editor. So on and so forth. Wouldn’t it be cool if you could create your own predefined Run commands?For example, let’s say I wanted to open a particular program when I typed in my name, Aseem, into the Run box? Right now if you type your name, you’ll probably get an error like the following:

Well, with a few simple registry hacks, we can create our own custom run commands to launch whatever program or file we like. Here’s how.

1. Open the registry editor by going to Start, Run and typing in regedit.
2. Now navigate to the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
3. Now right-click on App Paths and choose New and then Key.

4. Now give the key any name that you want, such as your name or whatever else you like. This will be what you type in the Run box later to launch the custom program. Just make sure that it has a .EXE at the end of the name.

5. Now in the right hand side, you’ll see a Default registry key (string value). Right-click on that and choose Modify. Enter the path to the file that you want to launch.
6. Click OK and then right-click in the white space and choose New – String Value.

7. Name the key Path and the value should be set to the path of the containing folder of the file you just set on the last key. So in my case, it would be F:\My Documents\GotSent\.
That’s it! Now you can go to Start, Run and type in the name you set for the new key in App Paths and your program will launch! For me, I will type “aseem” and GotSent will load up.

Note that you are not just limited to EXE files, you can point to any file type you like: PDF, DOC, AVI, MP3, etc, etc. That means you can create your own shortcuts to documents, videos, audio files, or programs! Enjoy!

No comments:

Post a Comment