LaunchBehavior Enumeration
Indicates how a process-based task is started.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
public enum LaunchBehavior
public enum class LaunchBehavior
Public Enumeration LaunchBehavior
Members
Member name | Description | |
---|---|---|
Default | Starts the task with the current user privileges. |
|
RunWithStandardUserPrivileges | Starts the task with standard user privileges. |
|
UseShellExecute | Use the ShellExecute function to start the task. |
Remarks
This enumeration is used by the ProcessTaskStartInfo object.
For more information about the ShellExecute function, see the Microsoft Web site (https://go.microsoft.com/fwlink/?LinkId=116154).
Examples
The following code example shows how to use the LaunchBehavior enumeration to run a program with standard user privileges:
TaskCollection tasks = new TaskCollection();
ProcessTaskStartInfo notepadTask = null;
notepadTask = new ProcessTaskStartInfo("notepad.exe");
notepadTask.LaunchBehavior =
LaunchBehavior.RunWithStandardUserPrivileges;
tasks.Add(new ProcessTask("Launch Notepad", notepadTask));
See Also
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top