|
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.IdentityAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.220-beta+a56b2444ff27b37e053039e60f062b99378309bd
Syntax Public Shared Function CreateProcessAsStandardUser (
fileName As String,
Optional arguments As String = ""
) As Process
public:
static Process^ CreateProcessAsStandardUser(
String^ fileName,
String^ arguments = L""
)
static member CreateProcessAsStandardUser :
fileName : string *
?arguments : string
(* Defaults:
let _arguments = defaultArg arguments ""
*)
-> Process
GSF.Identity.UserAccountControl.CreateProcessAsStandardUser = function(fileName, arguments);
View SourceParameters
- fileName String
- The path to the executable file.
- arguments String (Optional)
- The command-line arguments to pass to the process.
Return Value
ProcessA
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