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

后端 未结 4 1666
孤街浪徒
孤街浪徒 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:06

    You can use the Scheduled Tasks facility to accomplish what you want. For scheduling there is an option to schedule a program to run whenever a user logs on. There are options for running the task with alternate credentials.

    I couldn't tell you how to set this up programatically (there's probably a WMI interface for it) but it's easy to do through the UI.

提交回复
热议问题