我正在尝试使用此代码作为LocalSystem帐户启动进程
ProcessStartInfo _startInfo = new ProcessStartInfo(commandName);
_startInfo.UseShellExecute = false;
_startInfo.UserName = @"NT AUTHORITY\SYSTEM";
_startInfo.CreateNoWindow = true;
_startInfo.Arguments = argument;
_startInfo.RedirectStandardOutput = true;
using (Process _p = Process.Start(_startInfo)) {
_retVal = _p.StandardOutput.ReadToEnd();
_p.WaitForExit();
}
Run Code Online (Sandbox Code Playgroud)
但我总是得到相同的错误消息"登录失败:未知用户名或密码错误".调用该函数的用户是本地管理员,应该能够启动具有本地系统特权的进程.我也试过不同的组合,但没有运气.
我将不胜感激任何帮助.谢谢