Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

For example I launch via firefox by this command:

start firefox

How does "start" know where is my firefox.exe? I guess it reads it from registy (it is not defined in my PATH) but then how is the start command and the registry of the OS is interconnected? Exactly which registries are used?

share|improve this question

marked as duplicate by Karan, Dave M, Siim K, Canadian Luke, wizlog Feb 19 '13 at 19:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 2 down vote accepted

Yes, this information is stored in the registry.

The key

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

has subkeys for every application that you can run directly without being in the path.

The subkey firefox.exe has two values:

(Default)    C:\Program Files\Mozilla Firefox\firefox.exe
Path         C:\Program Files\Mozilla Firefox\

The first value specifies the full path of the executable, the second the directory it should run in.

Application Registration (Windows) explains in details where Windows would search for the firefox executable:

When the ShellExecuteEx function is called with the name of an executable file in its lpFile parameter, there are several places where the function looks for the file. We recommend registering your application in the App Paths registry subkey. Doing so avoids the need for applications to modify the system PATH environment variable.

The file is sought in the following locations:

  • The current working directory.
  • The Windows directory only (no subdirectories are searched).
  • The Windows\System32 directory.
  • Directories listed in the PATH environment variable.
  • Recommended:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.