I created a service in VB.NET and wanted to use the "sc" program to install it. (I needed to package it so that someone else in my organization could perform the actual install.)
I wanted the "Recovery" options to look as follows:
- First Failure: Restart
- Second Failure: Restart
- Subsequent Failures: Do Nothing
This is the command I initially attempted (after the actual install):
sc failure MyServiceName reset= 86400 actions= restart/15000/restart/30000
But then looking at the service in the GUI, "Subsequent Failures" was also set to restart. I looked on SO and couldn't find anything specific. I eventually figured it out, and I am posting this here in case anyone else is looking for the same "quick" answer I was. And of course, if anyone has anything to contribute, I would love to read it.