IVsLaunchPad4.ExecCommandWithElevation(String, String, String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
执行具有提升的给定命令。
public:
System::UInt32 ExecCommandWithElevation(System::String ^ pszApplicationName, System::String ^ pszCommandLine, System::String ^ pszWorkingDir);
public:
unsigned int ExecCommandWithElevation(Platform::String ^ pszApplicationName, Platform::String ^ pszCommandLine, Platform::String ^ pszWorkingDir);
unsigned int ExecCommandWithElevation(std::wstring const & pszApplicationName, std::wstring const & pszCommandLine, std::wstring const & pszWorkingDir);
public uint ExecCommandWithElevation (string pszApplicationName, string pszCommandLine, string pszWorkingDir);
abstract member ExecCommandWithElevation : string * string * string -> uint32
Public Function ExecCommandWithElevation (pszApplicationName As String, pszCommandLine As String, pszWorkingDir As String) As UInteger
参数
- pszApplicationName
- String
中环境传递到的应用程序名称 CreateProcess 。
- pszCommandLine
- String
中环境传递给的命令行字符串 CreateProcess 。
- pszWorkingDir
- String
中环境传递到的工作目录 CreateProcess 。 可以为 null。
返回
进程返回的退出代码值 (此值不能为 null) 。
注解
如果用户当前未以管理员权限登录,系统会提示用户提供系统提升提示。 与 ExecCommand 和 ExecCommandEx 方法相比,此方法缺少进程的管道输出的参数,并控制进程的生存期,因为这些操作不能在提升的进程中完成 (除非 Visual Studio 也以提升的) 运行。
与不同的 ExecCommandWithElevationIfRequired 是,如果用户尚未提升) ,则此方法始终强制提升 (; 此方法还会返回应用程序的退出代码。