当UAC被禁用时,应用程序以常规模式启动(即不考虑清单),凭证窗口(用于pipe理员的login名/密码)不会出现。
如果禁用了UAC,是否有办法强制运行(.NET)应用程序的Windows操作系统在(.NET)应用程序代码的pipe理特权(如“以pipe理员身份运行”上下文菜单)下运行?
使用pipe理权限运行应用程序的C#.Net代码:
ProcessStartInfo startInfo = new ProcessStartInfo(cmd); //cmd is the application you are trying to start startInfo.Verb = "runas"; // This will set it to run as an administrator startInfo.Arguments = args; // arguments to pass to the application that is being started Process.Start(startInfo);
你可以在这里find更多的信息