开发者

Scheduled Task windows server 2003

开发者 https://www.devze.com 2023-02-24 05:16 出处:网络
I have a program that I wrote set to run at startup.It\'s pretty much a polling program and does stuff when it sees that there are things to do.The problem is that if I need to stop the program then r

I have a program that I wrote set to run at startup. It's pretty much a polling program and does stuff when it sees that there are things to do. The problem is that if I need to stop the program then restart it later, it stops when I log off the server (which I remote into). If the server restarts, we can log in and log off all day long and the pr开发者_如何学Googram continues to run.

How can I run this program to mimic the restart with out restarting? It seems pretty drastic, and not at all feasible during the day.


You have a couple of options. One you can run the program as a scheduled task this allows the program to run A programmatically and B when no user is logged on. some disadvantages are that you will need to enter a user name and password into the scheduled task description and make sure that stays up to date. Also the failure handling in scheduled tasks is not very full featured.

your other option is to changed the program to a windows service and have it poll for itself. Hear you get all the things you got with option A but you also get OS integrated failure handling, notification, and remote control with WMI/pwoershell/computer manager. However, Services can be a pain to develop and will require you to write some code.

0

精彩评论

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

关注公众号