The useful App Paths registry Key:hkey_local_machine\software\microsoft\windows\currentversion\app Paths

Source: Internet
Author: User

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

How to load BPLs without writing them in the system directory or in the application directory.

I suggested to use the "APP Paths" registry key

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths],

But while the looking for a reference is proper use I didn ' t find a complete one, even on MSDN.

It looks to be poorly documented, yet it ' s a very useful key.

First, you had to create a key under the APP Paths key named after you application executable.

Then you have the following options:

    • If you set the "Default" value (which can is created passing an empty string as it name) to your application path and fil ENAME,
      Windows would be able to run it just typing the exe name in the "Run" dialog or "Address" toolbar
      (If you use it and ever wondered what it worked for some apps but not others, you know why now).

    • You can create a value (string type) named "Path",
      Which should contain a comma delimited list of directories where application DLLs can be found.

    • You can map a executable to another (look at the Pbrush.exe entry, which maps it to mspaint.exe).

Some Microsoft applications (i.e. Office) uses other values,
For example Useurl (set to 1), but I have no clue if they is application specific values stored there, or have a broader Meaning.

"Run" alternative magical, program start faster

We know that in Windows, when you click the start → run command, you can open some system tools by entering the appropriate command in the dialog box that opens.

Enter "regedit" to start the Registry Editor, enter "Notepad" to start the Notepad program, and so on.

However, by default, Windows can only support a handful of programs that use this handy feature,

Is there any way to allow more programs to enjoy such a convenient startup?

Of course: We just have to add some simple information to the registry and tell Windows what to do!

Open Registry Editor, expand

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths]

Branch, under the "APP Paths" PRIMARY key we can see a number of secondary primary keys named "Xxxxx.exe",

Click on a primary key to see its string on the right, where the "path" string is the path to the program.

Because of these primary keys, we can easily start a program in the Run dialog box.

Knowing this principle, we are free to add convenient start-up for other programs.

Take QQ As an example: we want to add a convenient starting mode for QQ, its installation path is

D:\Program Files\tencent\qq.exe.

Create a new subkey named "QQ.exe" under "App Paths" (cannot be duplicated with an existing name).

Then set the "Path" string to "D:\Program Files\tencent\qq.exe" in the right window.

Quit the Registry Editor and enter "QQ" directly in the "Run" dialog box, and you can start QQ!

Tip: In fact, we can also add a shortcut to any file, Windows will automatically call the appropriate program to open this file.

Add the same method as above, and enter the program's startup path in the "path" string.

It is important to note that the newly added secondary primary key name must have an extension, such as EXE, TXT, and so on.

If you use the EXE extension, you only need to enter a name in the Run dialog box;

If you use a different extension, you must enter a name + extension to start.

For example, using the name "CCE.exe", in the "Run" dialog box just enter "CCE" can be started;

If you use "CCE.txt", you need to enter "CCE.txt" to start the corresponding file.

The WINDOWS "APP PATHS" REGISTRY KEY

This is news to me. Basically, not every app have to is on your PATH to is launched via executable name only (from anywhere).

For example, on my x64 Windows 7 machine, WordPad are located at:

<c:\program Files\Windows Nt\accessories\wordpad.exe>

This is *isn't * set in my PATH environment variable. But I can go to Start > Run, and Type WordPad, and it launches.

Why does this work? Because of "App Paths".

<HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths>

How the APP Paths Registry Key makes Windows Both Faster and Safer

Why can I start Mozilla firefox by typing "Firefox" in the Run dialog and press ENTER?

Firefox.exe is isn't located in any directory in the path.

The same with Outlook (type "Outlook"), PowerShell ("PowerShell"), VMware Workstation ("VMware") or Adobe Reader ("Acrord3 2″).

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 your may has noticed a peculiar key,

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

That have subkeys named like executables. What's it looks like on my machine:

Notice the HKLM App Paths key and its counterpart in HKCU is basically mapping tables

Between executable names and their full paths.

The direct subkeys of the 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" have a named value "path" that stores the path to the program ' s installation Direct Ory.

So, what's this?

APP paths–explanation

The APP Paths Key provides a mechanism that allows programmers to make their application startable

By name only without have to modify the System-wide path.

Why would they does that?

Vanity and overestimation of the importance of one ' s own application.

But, hey, it sometimes does come in handy to being able to start programs without have to type the full path,

Just hit win+r instead and type the executable name.

Getting more technical, modifying the system path was not exactly best practice since it could slow down the system,

Break other applications and even create security holes.

To provide a alternative, Microsoft added the App Paths functionality in XP.

Whenever a new process is to being started with the API functions ShellExecute or ShellExecuteEx,

And only a file name without a path was specified, Windows looks in the following places for the executable:

    1. The current working directory.
    2. The Windows directory.
    3. The Windows\System32 directory.
    4. The directories listed in the PATH environment variable.
    5. 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 of named path, the string stored in path was added to the PATH environment variable, and only F Or 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.


The useful App Paths registry Key:hkey_local_machine\software\microsoft\windows\currentversion\app Paths

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.