IVsLaunchPad4::ExecCommandWithElevation Method (String^, String^, String^)

 

Executes the given command with elevation.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)

unsigned int ExecCommandWithElevation(
	String^ pszApplicationName,
	String^ pszCommandLine,
	String^ pszWorkingDir
)

Parameters

pszApplicationName
Type: System::String^

[in] Application name that is passed to CreateProcess by the environment.

pszCommandLine
Type: System::String^

[in] Command line string that is passed to CreateProcess by the environment.

pszWorkingDir
Type: System::String^

[in] Working directory that is passed to CreateProcess by the environment. Can be null.

Return Value

Type: System::UInt32

Exit code value returned by the process (this value cannot be null).

If the user is not currently logged in with administrator privileges, the user is prompted with the system elevation prompt. In contrast to the ExecCommand and ExecCommandEx methods, this method lacks the parameters for piping output from the process and controlling the process's lifetime, because these things cannot be done to an elevated process (unless Visual Studio is also running elevated).

In contrast to ExecCommandWithElevationIfRequired, this method always forces elevation (if user is not already elevated); this method also returns the application's exit code.

Return to top
Show: