Windows – How does the Run dialog know where applications are

run-dialogwindows

As a power user, I frequently use the Run dialog.

I can understand why the following commands work, as they are in the PATH environment variable.

mspaint
diskmgmt.msc
explorer

These commands also work in CMD.

The commands below work in run, but they are not in the PATH, and they don't work in CMD.

firefox
winword
iexplore

How does Run know where these files are?

Best Answer

When you execute a command from Run dialog, the system looks at the App Paths registry key here:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

and

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

EXAMPLE

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\filezilla.exe

(default) value data has the full path to the executable.

If it's not found, it looks at each folder included in the PATH.

Whereas the Command Prompt doesn't reference these registry keys. It only searches the PATH.