开发者

Set up a scheduled task programmatically

My application needs to set up a scheduled task on installation. The task is to run my program on several triggers (related to logon events). I am wondering what is the easiest way to do this? S开发者_运维知识库hould I use a batch file?

This program will run only on Windows 7.


That sounds more like a WindowsService than a scheduled task. The SystemEvents Class documentation includes an example of setting up a WindowsService that will then monitor for various system events (including SessionEnding and SessionSwitch). Monitoring for logon events would be difficult as you have something of a chicken/egg problem there. On the other hand, adding an application to run on startup is relatively simple and would let you know that a user has logged on...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜