Click or drag to resize

UserAccountControlCreateProcessAsStandardUser Method

Creates a process under the standard user if the current process is elevated. The identity of the standard user is determined by retrieving the user token of the currently running Explorer (shell) process.

Namespace: GSF.Identity
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public static Process CreateProcessAsStandardUser(
	string fileName,
	string arguments = ""
)
View Source

Parameters

fileName  String
The path to the executable file.
arguments  String  (Optional)
The command-line arguments to pass to the process.

Return Value

Process
A Process object representing the newly created process.
Remarks

This method requires administrative privileges. An exception will be thrown if the current user is not elevated.

This is an especially useful function if you are trying to shell an application from an installation program. With UAC enabled, an application spawned from a setup program will be the "NT AUTHORITY\SYSTEM" user - not the local user that executed the installer; this can wreak havoc if the spawned application needs to authenticate the local user.

See Also