Elevating process privilege programmatically?

前端 未结 5 859
情歌与酒
情歌与酒 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条回答
  •  心在旅途
    2020-11-22 00:38

    According to the article Chris Corio: Teach Your Apps To Play Nicely With Windows Vista User Account Control, MSDN Magazine, Jan. 2007, only ShellExecute checks the embedded manifest and prompts the user for elevation if needed, while CreateProcess and other APIs don't. Hope it helps.

    See also: same article as .chm.

提交回复
热议问题