How the App Paths Registry Key Makes Windows Both Faster and Safer
|
by Helge Klein on 08/26/2010 | 5 Comments | 7,171 Views
|
Why can you start Mozilla Firefox by typing "firefox" in the Run dialog and press enter? Firefox.exe is not located in any directory in the path. The same with Outlook (type "outlook"), PowerShell ("powershell"), VMware Workstation ("vmware") or Adobe Reader ("acrord32"). This "magic application starting thingy" works because of a little-known Windows feature based on the "App Paths" registry key.
App Paths - Dissection
In your forays through the Windows registry you may have noticed a peculiar key, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths, that has subkeys named like executables. Here is what it looks like on my machine:
Notice that the HKLM App Paths key and its counterpart in HKCU are basically mapping tables between executable names and their full paths. The direct subkeys of App Paths store the executable names, while each subkey's default value stores the full path to that executable.
Notice also, that the key "firefox.exe" has a named value "Path" that stores the path to the program's installation directory.
So what is this all about?
App Paths - Explanation
The App Paths key provides a mechanism that allows programmers to make their application startable by name only without having to modify the sytem-wide path.
Why would they do that? Vanity and overestimation of the importance of one's own application. But, hey, it sometimes does come in handy to be able to start programs without having to type the full path, just hit Win+R instead and type the executable name.
Getting more technical, modifying the system path is not exactly best practice since it may slow down the system, break other applications and even create security holes. To provide an alternative, Microsoft added the App Paths functionality in XP. Whenever a new process is to be started with the API functions ShellExecute or ShellExecuteEx, and only a file name without a path is specified, Windows looks in the following places for the executable:
- The current working directory.
- The Windows directory.
- The Windows\System32 directory.
- The directories listed in the PATH environment variable.
- If there is a App Paths subkey with the name of the executable, the key's default value is used as the program's full path. If the subkey also has a value named Path, the string stored in Path is added to the PATH environment variable, but only for the process to be started.
As mentioned, the App Paths key has a second use, namely proving per-process PATH configurations, reducing the need of application developers to modify the global system PATH.
For further information and a list of other possible values please see the MSDN article Application Registration.
- ‹ previous
- 132 of 156
- next ›
+++ Your opportunity +++ Use Profile Migrator 2, the new sepago product that makes migrating user personalities between different platforms a breeze.! Download your free version now!
5 responses for "How the App Paths Registry Key Makes Windows Both Faster and Safer" |
Recent Articles
About the author
![]() |
Helge Klein Consultant Blogs about Windows, Terminal Services and other things |
Most viewed
| 274,845 Views |
Where is the Hosts File on Windows x64? |
| 122,332 Views |
Deleting a Local User Profile - Not as easy as one Might Assume |
| 70,751 Views |
Printer Driver Isolation in Windows 7 and Server 2008 R2 |






Hi Helge, As a matter of
Hi Helge,
As a matter of fact, this App Paths registry entry must also be take into account when analysing applications dependencies. This is done in PeStudio - http://www.winitor.net/en/pestudio.html
Bests
Thanks Marc, I just
Thanks Marc,
I just downloaded your PeStudio - looks good! And it is even free.
Hi Helge, thanks. PeStudio
Hi Helge,
thanks. PeStudio has some troubles when running on Windows 7 x64 bit. This is documented on my web-page.
On Windows XP x64 it runs perfectly.
This will be corrected in the next days.
Bests
Marc Ochsenmeier
the Windows path 'design' is
the Windows path 'design' is simply stupid. You can try and fix it with this app path thing, but it remains stupid.
Hi Helge, I didn't know this
Hi Helge,
I didn't know this key was used when using the search in the Start Menu, good to know!
I did found another (personal) use for this key, I use it in TSAdminEx (http://www.remkoweijnen.nl/blog/2009/02/25/tsadminex-features-part-3/) to find the complete path when I just have an exe name in order to be able to display the Process Icon