Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

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?

share|improve this question

marked as duplicate by Oliver Salzburg Jul 26 '12 at 19:36

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.

It depends on the context. If you're entering "firefox" from a command line, then firefox.exe must either be in the path or in the Windows or Windows\System32 folders. If you're entering "Firefox" in the Run dialog, the App Paths registry is used, so firefox.exe is registered there. – boot13 Jul 25 '12 at 13:20
Thanks boot13, I was not aware of the App Paths registry keys. – Mathew Jul 25 '12 at 13:30
up vote 100 down vote accepted

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.

share|improve this answer
One of the best answers to a question I've ever seen. +1 – Everett Jul 25 '12 at 13:19
That was it, thank you sir. Learn something new everyday. – Mathew Jul 25 '12 at 13:28
@Mathew You're welcome. Keep in mind that the "App Paths" subkey also exists in the HKCU hive for applications that were installed for one user only. – JC2k8 Jul 25 '12 at 13:36
So that's why I never really had to muck around with the PATH until I went from .NET development to Java development. I never really considered why everything in .NET development "just works"! – Stephen Swensen Jul 25 '12 at 18:59
This is only true for the Windows Run dialog, in cmd.exe and powershell only 1. through 4. are used, see also boot13's comment. – Alexander Jul 26 '12 at 12:21

Not the answer you're looking for? Browse other questions tagged .