因为我想cmd
在进程中以管理权限运行,但弹出窗口甚至将其设置WindowStyle
为隐藏。
ProcessInfo = new ProcessStartInfo("cmd.exe", "/c " + @"cscript.exe DTCSECURITY.vbs");
ProcessInfo.CreateNoWindow = true;.
ProcessInfo.WindowStyle = ProcessWindowStyle.Hidden;
// Here with i pass the privillage
ProcessInfo.UserName = @"administrator";
ProcessInfo.Password = StringToSecureString("password12$");
process = Process.Start(ProcessInfo);
process.WaitForExit();
但是,如果我评论特权代码,则不会弹出闪烁。