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:
- The current working directory.
- The
Windows
directory only (no subdirectories are searched). - The
Windows\System32
directory. - Directories listed in the PATH environment variable.
-
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
(alsoHKEY_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.