How is a program that's not in my path being run? [duplicate]

Possible Duplicate:
Why am I able to execute a program that is not in my PATH environment variable?

I was teaching a coworker about %PATH% and found that if I run "Firefox", it works, but was surprised to see that it was not in my path.

What am I missing?


If you're trying to run an executable by only specifying its name, Windows looks for the file in the following locations:

  1. The current working directory.
  2. The Windows directory only (no subdirectories are searched).
  3. The Windows\System32 directory.
  4. Directories listed in the PATH environment variable.
  5. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths (also HKEY_CURRENT_USER since Windows 7)

Microsoft actually recommends "registering" applications in the App Paths subkey to avoid the need for applications to modify the system PATH environment variable. The application's installer will register the executable.