Reputation: 1803
I have some security related service running on my machine (start type = automatic) In the service control manager, the stop/restart commands are grayed out.
I was wondering how can I develop such service for which the stop operation is disallowed.
Note that I am logged in as an administrator
Upvotes: 2
Views: 1167
Reputation: 1468
All you need is to disallow your service to recieve stop requests.
If you are writing service in C/C++ you should not specify SERVICE_ACCEPT_STOP
flag when calling SetServiceStatus (see SERVICE_STATUS for details).
If your are using .NET, set ServiceBase.CanStop to false
.
Upvotes: 4