Freigeben über


Using the RelaunchElevated Fix

Applies To: Windows 7, Windows Vista

This section includes information about using the RelaunchElevated compatibility fix, including the associated issues and usage.

RelaunchElevated

The RelaunchElevated compatibility fix enables you to automatically elevate child applications when the parent process that calls the CreateProcess API is difficult to determine. This compatibility fix works by redirecting the executable's entry point to jump to code inside of the fix itself, which then restarts the application with elevated permissions. For example, it is a common practice for a Web download to change its name. By using this compatibility fix, it is possible to specify the child executable whose name does not change, instead of the parent, whose name might change.

Note

If the application contains a User Account Control (UAC) manifest, the compatibility fix will be disabled, and the application will not start with elevated permissions. In addition, you might have to also apply the Using the SpecificNonInstaller Fix to further prevent the application from failing to start with elevated permissions.

Investigating the Issue

The RelaunchElevated compatibility fix should be considered as a possible resolution if you receive the ERROR_ELEVATION_REQUIRED failure and if you are unable to consistently target the parent application by using the ElevateCreateProcess compatibility fix due to an unexpected name change by the parent application.

Intercepted APIs

None. This compatibility fix interrupts the application start process, and then creates a new elevated instance each time the targeted application is started.

Fixing Your Code

You can remedy this issue by creating a manifest for the specific application that includes the desired run-level (requireAdministrator), and then by using the ShellExecuteEx API to invoke this specified executable file.

See Also

Concepts

Windows Vista and Windows 7 Operating Systems