How does the windows run dialog locate executables?

19

5

When I enter "firefox" in the windows run dialog (i.e. the dialog that appears when you hit windows+R), firefox will launch.

However, "firefox.exe" is not in my %path% because when I type "firefox" in cmd.exe, I get

'firefox' is not recognized as an internal or external command, operable program or batch file.

So apparently an executable doesn't need to be found in the windows %path% in order to be discoverable by the run dialog. How does this work?

wcoenen

Posted 2009-12-24T17:21:11.560

Reputation: 2 060

Answers

29

Apparently the run dialog checks not only the %path% environment variable, but also the "App Path" registry key. From a techrepublic article about the run dialog:

You can launch some third-party applications by typing the name of the executable file in the Open text box and clicking OK—even though the paths to these applications don’t appear in the path environment variable. The reason that this is possible is because the installation procedure for some applications adds the executable file's path to a special registry key called App Paths.

The relevant locations in the registry are HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths and HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths (this last one being specific to the user). You can add your own "app paths" there with regedit.

wcoenen

Posted 2009-12-24T17:21:11.560

Reputation: 2 060

Also, don't forget to check HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths. I was encounter this problem as well because I installed Beta + Canary versions of Chrome but couldn't understand why Canary was opening but not the stable version of chrome, despite both not being in the %PATH%. Turns out this answer helped, but it was under HKCU instead of HKLM! – chunk_split – 2019-11-11T20:47:39.460

1@chunk_split thanks, answer updated – wcoenen – 2019-11-12T10:15:58.480

Thank you, I was baffled by the same thing (firefox) and your answer explained it well. – Adam Plocher – 2013-12-20T23:31:42.190

2

The Run dialog on newer versions of Windows will also run shortcuts found in your start menu. I'm not sure when this started working... it may go back as far as Windows 95, though I do not think so.

Edit: This answer is wrong. The correct answer is the App Paths registry key, as answered above.

Myrddin Emrys

Posted 2009-12-24T17:21:11.560

Reputation: 2 122

If this is wrong, then you should have deleted it. Though, honestly, that seems like expected behavior to me. – 287352 – 2015-01-30T08:30:12.563

I believe it was XP, but not certain. – BBlake – 2009-12-24T19:03:39.887

1This doesn't seem to be the correct explanation. I can find counter examples of applications in my start menu (such as TrueCrypt) which I can't start via the run dialog. – wcoenen – 2009-12-24T20:52:11.120

The Run dialog remains unchanged even in recent versions of Windows. The search box in the Start Menu is another matter, though. But that's more a search box that also happens to run programs found in the PATH. – Joey – 2009-12-25T00:38:38.137