Windows DatabaseebooksStatistical Information

LWE10151 : Howto use Application Specific Paths in windows

Symptom:

You are having application problems because the path does not seem to work.

Cause:

none

Solution:

Microsoft has offered a solution to all these problems. An application can now store it own path in the registry under the following key:

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

The use the application path, set a key for your application, using testapp.EXE from the example above:

HKEY_LOCAL_MACHINE\...\CurrentVersion\App Paths\testapp.exe

Set the (Default) value to the full path of your executable, for example:

C:\Program Files\testapp\testapp.exe

Add a sub-key named Path, set it's value to the full path of the DLL, for example:

C:\Program Files\Common

With an App Path registry entry, the system will load DLLs in the following order.

   1. The directories listed in the App Path registry key
   2. The directory where the executable module for the current process is located.
   3. The current directory.
   4. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
   5. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
   6. The directories listed in the PATH environment variable.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!
Copyright © 2004-2011 Lubby (V3.0.10 Aug 2011)
Sponsored by Keskon.
Statistical information by Google Analytics