Under the Services application, select the properties of the service in question.

View the recovery tab - there are all sorts of options - I'd set First & Second Failure to Restart the Service, Third to run a batch program that BLAT's out an email with the third failure notification.

You should also set the Reset Fail Count to 1 to reset the fail count daily.

Anywhere. With SC failure w3svc command= "MyBatchFile.cmd" it should be in the path or C:\Windows\System32. You can put it in any directory if you use a full path i.e. SC failure w3svc command= "c:\Stuff\MyBatchFile.cmd"
–
Christopher_G_LewisJan 2 at 22:19

Someone asked a similar question over at Super User: You could install a tool that monitors windows services. Something like Service Hawk would help you keep the services started, or allow you to schedule automatic restarts (possibly during the night) to keep the service running smoothly.

I am using ServiceKeeper on my windows 2008 server at HostForLife.eu and it works very good. Previously, I had a review on ServiceHawk, but I prefer to use ServiceKeeper for its easier management and interface.