How to design autostart application that runs as admin on Windows Vista/7?

后端 未结 4 1702
孤街浪徒
孤街浪徒 2021-01-15 02:28

I have the need for my application to start and stop Windows Services based on certain events. The thing is that this application needs to run as an elevated normal user (In

4条回答
  •  甜味超标
    2021-01-15 03:11

    Actually with number 1 you can chain a couple processes together to achieve an elevated process without a UAC dialog. Like this

    First Process-> Launch as Administrator (will need a way to supply credentials) -> launch another process using ShellExecute and supplying the Runas verb. -> Your final process

提交回复
热议问题