Does the Windows Command Prompt search somewhere other than those locations specified by the PATH variable when launching application programs?

At first, I thought that cmd only looks for executables in the directories contained in the PATH variable, so I randomly picked an application - winword.exe (Microsoft Word) and tried to launch it from the command line:

The reason winword.exe worked is that a registry key exists which defined the path to Microsoft Word (Winword.exe). A similar key exists for Firefox.exe and Chrome.exe if those applications are installed.

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

What I want to know is where exactly does the command prompt look for executables?

System PATH Variable, User PATH Variable, and the various keys within ..\App Paths. I was able to confirm that Audacity does not create a key for itself when it's installed.

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 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

Source: Application Registration


From the command prompt, if you just enter WinWord it fails to run.

If you enter START WinWord it runs.

The Start command is key here.

When you try to execute a file through the start command, Command Prompt does not perform any searching. Instead, it passes the file name (and arguments) over to Windows itself (via the ShellExecuteEx API call), which must then search for the file's location. There are several places it searches in the following order:

  • 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

WinWord is in that registry key. The key is there to keep PATH from getting too long.