Customizing Windows Run Command...

If you are like me you use windows run command all the time.  I hate using the mouse to point and click a shortcut on the start menu.  WIN-R are probably the two most over used keys on my keyboard.  After thinking about if awhile I hunted down how the run command works.  It turns out that it makes a call to ShellExecute, which I guess is not too surprising.  The next thing I wanted to find out was exactly how the commands are resolved. The following is an ordered list of how they are resolved ([1]):

  • The current working directory
  • The Windows directory (no subdirectories are searched)
  • The Windows\System32 directory
  • Directories listed in the PATH environment variable
  • The App Paths registry key

Naturally the next thing I wanted to do was customize existing commands or add new commands so I do not have to type as much (standard lazy approach).  After examining my options which were to put the executable in one of those paths (since it only locates executables and not shortcuts), modify the path environment variable or add a key to App Paths. The App Paths option seems to be the easiest and most flexible to me.  Here is a layout of what you need to do to add an App Paths entry ([1]):

HKEY_LOCAL_MACHINE
    SOFTWARE
        Microsoft
            Windows
                CurrentVersion
                    App Paths
                        file.exe
                           (Default) = The fully-qualified path and file name
                           Path = A semicolon-separated list of directories
                           DropTarget = {CLSID}

Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. I cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.

The minimum needed to add a new entry is to add the key file.exe where file is the string you want to type into the run command and to add the Default entry which is the fully-qualified path to the file you want to execute. Note that even it the file you are going to reference isn't an exe file you still need to put the .exe on the key. Here is a sample registry file that I created to add a shorter keyword for Internet Explorer:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ie.exe]
@="C:\\Program Files\\Internet Explorer\\iexplore.exe"

After entering that entry into the registry I can simply type “ie” at the run command to open internet explorer.

Here is a list of some common commands I use at the run command:

  • cmd – Command prompt
  • winword – Microsoft Word
  • excel – Microsoft Excel
  • outlook – Microsoft Outlook 
  • iexplore – Internet Explorer
  • firefox – Mozilla Firefox
  • notepad – Notepad
  • compmgmt.msc – Computer Management Console
  • control appwiz.cpl – Add/Remove programs dialog
  • mstsc – Microsoft Terminal Service Client
  • regedit – Registry Editor

If there is some program that I find myself using all the time I figure out what the run command is for it and if there is not a short easy one I add one to my App Paths as described above.  Does anyone else have some other common run commands they use?

 [1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/fileassociations/fa_perceived_types.asp

Published Sunday, April 11, 2004 12:54 PM by puzzlehacker

Comments

# re: Customizing Windows Run Command...

The run command (ShellExecute, as you said) also supports keyword expansion, so you can type any special path that's in your environment variables and go the the appropriate directory:
My Documents
System32
Temp
ProgramFiles
HomePath
AppData
etc.

To see what's in your list: win-r, cmd, set.

Sunday, April 11, 2004 3:05 PM by Jon Galloway

# re: Customizing Windows Run Command...

Yes I did forget about those. Also lets not forget about the intellisense for the directory structure. Meaning when you start typing a directory it gives you a drop down list of the files/directories that match what you have typed so far.

Sunday, April 11, 2004 3:23 PM by Wes

# re: Customizing Windows Run Command...

Everything you just listed plus:
inetmgr - IIS Manager
services.msc - Services SnapIn
eventvwr.msc - Event Viewer SnapIn
And of course replace notepad with UltraEdit

Sunday, April 11, 2004 3:26 PM by Dan Bright

# re: Customizing Windows Run Command...

sweet man

Saturday, April 17, 2004 1:54 AM by joppe

# re: Customizing Windows Run Command...

I pretty much use everything in your list. I don't really use a start menu much. I just use env variables and program names i know...

Thursday, May 06, 2004 10:14 PM by Brian Desmond

# re: Customizing Windows Run Command...

I use:

runas /user:administrator cmd

a great deal.

Friday, May 07, 2004 4:59 AM by John Topley

# re: Customizing Windows Run Command...

instead of compmgmt.msc, i use mmc at the run dialog.
also lusermgr.msc
and gpedit.msc
most things are run from the winkey+r>cmd prompt

and if you are on 98/me/etc. you can goto the command folder and add in your own shortcuts, just drag in the command folder and rename it to what you want, then simply hit winkey+r and type it in.

Tuesday, May 11, 2004 8:15 AM by VORTEX

#

Wednesday, May 12, 2004 11:59 AM by TrackBack

# re: Customizing Windows Run Command...

another nice one is "devenv" for Visial Studios

It you have a friend that use the win key, a nice trick to is modify the registry to disable the left win key.

Go to this link for more info:
http://www.microsoft.com/whdc/device/input/w2kscan-map.mspx

Be sure to tell them before they buy a new keyboard though. I almost bought a new one when someone did it to me.

Tuesday, May 18, 2004 9:24 PM by ViperNKY

# re: Customizing Windows Run Command...

I'm trying find the target for the Run command. We are already using the practice of "runas" on our apps so we can run administration utilities under a domain admin account. We'd like to run the "run" command as a domain admin so when we navigate to network file resources, we can see/change securities, etc., under the domain admin account. Anyone know how to create a shortcut to "Run" that can be edited to "runas"?

Friday, May 28, 2004 1:40 PM by Damon

# re: Customizing Windows Run Command...

Hi all:
Like Damon I need to be creating a shortcut to the 'Run' command on my quick launch bar. I have created a short cut as an icon to my 'command' window which I use very frequently.
Pl. let me know if there is a way to do it. Please e-mail to avramreddy@hotmail.com.
Thanks in advance.

VA.

Monday, May 31, 2004 12:45 AM by VA

# re: Customizing Windows Run Command...

I somehow erased my run commands. The ones I use are msconfig and something that let me see if I was connected to and ISP. Could you tell me what that was for ME? Thanks-obviously I only know enough to be dangerous.

Tuesday, June 22, 2004 11:08 PM by Forgetful

# re: Customizing Windows Run Command...

Hey guys,

I also prefer to use Run Command but I'm having a problem with that.
I changed the default location of "My Documents" folder and now I can't open it with Run Command.
Do you know what I need to do to keep it working like before?

Thanks

Wednesday, July 21, 2004 1:19 PM by Mota

# re: Customizing Windows Run Command...

Hi,
I was wondering if you know ActiveWords. It is a keyboard enhancement utility that allows you to turn words, abbreviations, acronyms and even phrases into commands. The commands can be either typed or selected from a screen, for example from a web page. The program is mostly used by people who prefer using the keyboard over the mouse.

My blog (http://dutchisms.typepad.com/awesome) is dedicated to ActiveWords. I'd be willing to tell you more about it if you want. Alternatively, download a trial version from http://www.activewords.com/plus_download.html.

I use ActiveWords commands a lot from the address toolbar which I placed in my Windows taskbar permanently.

I hope this helps.

Kind regards,
Marjolein Hoekstra

Monday, July 26, 2004 6:17 AM by Marjolein Hoekstra

# re: Customizing Windows Run Command...

Amazing, just amazing. I've been meaning to figure this out for a while, but thanks to google and you, my life has been greatly improved. As soon as i saw the list of programs that i usually type i changed like 15 of them to only a few characters. Thanks a lot.

Friday, July 30, 2004 9:29 AM by Dan

# re: Opening an application from

Wednesday, November 10, 2004 1:22 PM by TrackBack

# re: Customizing Windows Run Command... How to

Hi, I want to remove the entries from the run command, like if any url addresses or file names that was opened recently appears on the run command line. I tried clearing the cache, history log and Temporary folders, still I'm able to see those files and URL addresses in run command. How to remove them, I need to remove them as I'm using a common machine, I don't want others to see those files even on run command. -KSK

Tuesday, August 01, 2006 12:11 AM by KSK

# re: Customizing Windows Run Command...

To remove the history you need to clean all the values from the HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU\ key in the registry.

Tuesday, August 01, 2006 1:41 AM by puzzlehacker

# re: Customizing Windows Run Command...How to , problem persists ;(

Thanks for your inputs Puzzle Hacker, but the problem still persists, between I use WIN xp professional and IE 6... if you have anyother solutions let me know , I will try it out...

Wednesday, August 02, 2006 1:29 PM by KSK

# Customizing

Have you tried changing the layout of your windows? this may help a friend had trouble on this.

Thursday, August 17, 2006 7:45 AM by Zen

# re: Customizing Windows Run Command...

Thanks for this tutorial. It works great on my windows machine:D

Thursday, September 21, 2006 12:59 AM by Raymond

# re: Customizing Windows Run Command...

Hey,

Nice entry. I'm a hard core keyboard junky too. I'd like to customize the run program. Any ideas on how to do this without a rewrite? When you type text into the textarea a dropdown list is populated with the files location in the path you type. (Typing c:\temp displays all of thoes files.) But the width of the dropdown is too short! I want that dropdown to default to the width of the screen. Anyway to do this? I've been using spy++ to try to get a handle on that control. But no luck, I could rewrite run I guess.

Any ideas? runcmd.20.zdux0012 (at) xoxy.net

btw

(Check out AutoHotKey, Logitech's G15, and the following keyboard shortcuts: Alt+Space, Alt+Space+n, Alt+Space+x, Alt+Space+s then right arrow key then move the mouse)

Thursday, December 07, 2006 2:24 PM by Drew

# re: Customizing Windows Run Command...

<h1> thanks for this tutorial. It works great on my windows machine. </h1>

Tuesday, January 09, 2007 6:42 AM by Bijesh

# re: Customizing Windows Run Command...

I was really looking for this. Thanks so much! :)

Thursday, January 11, 2007 1:39 PM by MMJ

# Clearing the cache list

hey i tried to delete those files that you said for the runrmu but they are still there. what do you mean by changing the layout of windows?

Sunday, March 18, 2007 11:46 AM by 110102

# re: Customizing Windows Run Command...

Hi,

You also can put shortcuts into C:\Windows\System32 and then type in the name of the shortcut in the run bar and it will work :)

Sunday, May 06, 2007 5:19 PM by mathijs

# re: Customizing Windows Run Command...

Wew its great help... dang I spent almost 30minutes just too look for this solution :)

Saturday, June 02, 2007 11:08 PM by Fernan Vecina

# re: Customizing Windows Run Command...

Wow!! Its great. Thanks a lot for your help.

Thursday, July 05, 2007 8:14 AM by Praneeth

# re: Customizing Windows Run Command...

I had send a message using net send command in the run window itself. But its entries are maintained

while opening the window again.

what can i do for that?

Thursday, August 23, 2007 1:10 AM by Divya

# Customizing Windows Run Command&#8230; | Sysadmins learning

Pingback from  Customizing Windows Run Command&#8230; | Sysadmins learning

Tuesday, September 11, 2007 11:22 AM by Customizing Windows Run Command… | Sysadmins learning

# re: Customizing Windows Run Command...

I am still looking for the answer to this question, and I hope someone here can help.

I need to know what to paste into a shortcut to make the "Run" dialog to pop up.

Any ideas?

Thursday, October 11, 2007 7:14 PM by Bryan

# re: Customizing Windows Run Command...

This is so great. Thanks

Tuesday, October 30, 2007 4:03 AM by Jinn

# re: Customizing Windows Run Command...

This is great!

I realise now that i'm not the only one who hates to "search and click" for applications!

The way I choose do to it was addind a folder to the path and placing shortcut into that path. This is easier for me to sync it between my computers.

Monday, December 10, 2007 11:36 AM by JS

# re: Customizing Windows Run Command...

Brainstorm Question:

I surfed to this forum seeking a way to customize the Run Command.  In trying to build a better kiosk, I would like to keep the Run Command accessed from the Start button (rather than remove it, possible via regedit.)  Is there a way to add a password condition in order for Run to execute a command?

Tuesday, December 18, 2007 6:42 PM by Bill

# re: Customizing Windows Run Command...

Huzzah! This is so helpful for PuTTY. Thanks.

Sunday, February 10, 2008 5:10 PM by Braden

# re: Customizing Windows Run Command...

shutdown -i on network computers and you type an ip address in add and shut down other peoples computers hahaha

Wednesday, April 30, 2008 5:05 PM by jim

# re: Customizing Windows Run Command...

these are really useful commads for time-saving. For the first time, I realize that we have to play with our computer to learn more and also finding the easier method of doing our existig routine job.

Thanks for this useful information.

Monday, May 19, 2008 9:29 AM by Sameer Chaudhary

# re: Customizing Windows Run Command...

When combined with VBS-scripts, this tip can be used to create helpful shortcuts to Google searches, etc...

Tuesday, June 10, 2008 4:39 AM by Blankdragon

# re: Customizing Windows Run Command...

Great tips, but if you're really into this, perhaps an alternative program would be useful.  Executor (linked) is great, portable and free.  Works without administrative rights too (I use it at college).

Saturday, June 14, 2008 4:36 PM by Sean

# re: Customizing Windows Run Command...

In answer to above questions... shortcuts to access run command should point to cmd.exe

Tuesday, June 24, 2008 9:06 AM by AlaskaJohn

# re: Customizing Windows Run Command...

Great tips!

I'm running XP Pro and IE6, and I had to clear "History" in Internet Explorer before my Run cache was completely cleared.

Monday, July 21, 2008 2:43 PM by Nathan

# re: Customizing Windows Run Command...

I've always created shortcuts and placed them in C:\windows.  It worked well until I tried to add a shortcut with the same name as a directory with the same name.  Using the App Paths registry key, you can gain precedence over the shortcuts/directories/files located in C:\Windows\

Saturday, September 13, 2008 9:06 PM by Shawn

# phillhutt :: Making life easier

Pingback from  phillhutt   ::  Making life easier

Tuesday, September 23, 2008 10:49 PM by phillhutt :: Making life easier

# re: Customizing Windows Run Command...

Win Xp2002-SP2.I dont have the run command in the start menu.I ve gone through all options in customize start menu .. but i couldnt find an option to add run command.

Iam also an admin user in my home p.c.Plz help me with this.

Wednesday, October 15, 2008 10:00 PM by Pandian

# &quot;Run&quot; command discovery - aha! that&#8217;s how &laquo; Taking it Upwards with SBS - Dale aka SBSisyphus&#8217; Weblog

Pingback from  &quot;Run&quot; command discovery - aha! that&#8217;s how &laquo; Taking it Upwards with SBS - Dale aka SBSisyphus&#8217; Weblog

# re: Customizing Windows Run Command...

%windir%\system32\rundll32.exe shell32.dll,#61

Monday, March 30, 2009 3:05 PM by CopyCat

# re: Customizing Windows Run Command...

Wicked, my first registry adjustment works just fine!

Tuesday, April 21, 2009 6:00 AM by Arjan

# re: Customizing Windows Run Command...

I have an internal only html page and I would like the user to be able to click a link that will invoke the run command on an ip address allowing a user to log in.  Any ideas??

Thanks

Thursday, May 21, 2009 10:30 AM by Brian

# re: Customizing Windows Run Command...

very useful! thanks

Friday, November 06, 2009 9:10 AM by Michal Linhard

Leave a Comment

(required) 
(required) 
(optional)
(required)