I have a service that will be unavailable if some resources are unavailable. I configured it to try restarting twice, and then send me an SMS on the third attempt. Unfortunately, only windows give you the ability to reset the failure count after a certain number of days, while I really want to reset it every third failure. The problem is that after the service resumes, another failure will cause it to send another SMS and not even try to restart the service.
So, I want to include some code in my SMS script in the reset counter failure. I found the following registry location:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \
Which contains, among other things, (binary) settings for failure actions, but without a counter, as far as I can tell.
The sc command allows you to query all kinds of materials, but also does not return an error counter.
Ideally, I would like to request / reset the failure counter programmatically, but a command line or registry solution would be fine (since I can script them).
source share