Elevating process privilege programmatically?

前端 未结 5 861
情歌与酒
情歌与酒 2020-11-22 00:05

I\'m trying to install a service using InstallUtil.exe but invoked through Process.Start. Here\'s the code:

ProcessStartInfo startInfo = new Pro         


        
5条回答
  •  梦毁少年i
    2020-11-22 00:43

    [PrincipalPermission(SecurityAction.Demand, Role = @"BUILTIN\Administrators")]
    

    This will do it without UAC - no need to start a new process. If the running user is member of Admin group as for my case.

提交回复
热议问题