开发者

How can I start my Windows service on startup, and prevent users from stopping/restarting it?

i have developed the window service. in this i want to start the service only when starting the computer. user can not start/stop/restart the service.manually these all thing are handle when user start the computer.

or lock the all properties from the user.all working done开发者_StackOverflow by coding when we start the computer.


There are two ways to accomplish this that I can recommend.

  1. Permissions. Normal users should not have permissions to start/stop services. If they do and are not administrators, you can at least remove permissions to start/stop the particular service you want to protect. http://msmvps.com/blogs/erikr/archive/2007/09/26/set-permissions-on-a-specific-service-windows.aspx

  2. Restart. You can have a scheduled task to automatically restart the service if it is stopped. Again, you can use permissions to make sure the scheduled task is not modified. You can even run the task remotely as long as the target computer is on the network.


Would you want some software installed on your PC to prevent you from starting or stopping it and just automatically forcing it to run....? I don't think so, this is a bad idea and am pretty sure security settings in windows will not allow this...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜