全部。这可能看起来像一个重复的问题,在这里有很多关于提升和降低儿童进程的问题。 我知道使用UseShellExecute = true连同Verb = "runas"选项以提升权限启动子进程。 例(在许多问题的答案找到): var info = new ProcessStartInfo(Assembly.GetEntryAssembly().Location)
{
UseShellEx
使用运行时,UAC和安全管理 请在尝试运行这段代码: try{
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec("netsh wlan show hostednetwork");
}
catch (Exception e){}
然后我得到这个错误: You must run this command at
我有一个InnoSetup安装程序,通常可以以非管理员身份运行,但在某些情况下,如果满足条件,需要使用提升的特权运行。所以我设置PrivilegesRequired以lowest,以确保它不会显示UAC提示不需要时,如果条件满足,我试图重新启动它为管理员这样的: if not ShellExec('runas', ExpandConstant('{srcexe}'), GetCmdTail(),