Windows Service Recovery Property?

  • Thread starter Strahimir Antoljak
  • Start date
S

Strahimir Antoljak

I am creating a new windows service and I would like to control its Recovery
property. On a system administrator level the Recovery property is found in
Control Panel -> Administrative Tools -> Services -> Service Properties
(right click on a service) -> Recovery tab [in the ClipBook Properties
(Local Computer) dialog box] -> First failure, Second failure properties.

Would anyone know if I can (and how) control First, Second Failure property
programmatically instead of going to the Administrative tools? Or would
anyone know how to deal with this automatically when installing or starting
the windows service?

Thanks,
 
S

Strahimir Antoljak

thanks Richard for a guideline
--
Strah @ Langan

Richard said:
I don't think there is any .NET API to explicitly do this. If there is it
would be hanging off of the ServiceInstaller class and I don't see one...
BUT the recovery settings are just registry entries so in a worst case
scenario all you'll have to do is add some registry writes to your service
installer/uninstaller logic... I dunno registry keys/values offhand but if
you fire up regedit and poke around a service that has non default settings
you'll find them...

--Richard

Strahimir Antoljak said:
I am creating a new windows service and I would like to control its Recovery
property. On a system administrator level the Recovery property is found in
Control Panel -> Administrative Tools -> Services -> Service Properties
(right click on a service) -> Recovery tab [in the ClipBook Properties
(Local Computer) dialog box] -> First failure, Second failure properties.

Would anyone know if I can (and how) control First, Second Failure property
programmatically instead of going to the Administrative tools? Or would
anyone know how to deal with this automatically when installing or starting
the windows service?

Thanks,
 
G

Guest

I found this page which may answer your question:

A ServiceInstaller Extension That Enables Recovery and Autostart Configuration
http://www.thecodeproject.com/csharp/SercviceInstallerExt.asp

Mike Mazar

Strahimir Antoljak said:
thanks Richard for a guideline
--
Strah @ Langan

Richard said:
I don't think there is any .NET API to explicitly do this. If there is it
would be hanging off of the ServiceInstaller class and I don't see one...
BUT the recovery settings are just registry entries so in a worst case
scenario all you'll have to do is add some registry writes to your service
installer/uninstaller logic... I dunno registry keys/values offhand but if
you fire up regedit and poke around a service that has non default settings
you'll find them...

--Richard

Strahimir Antoljak said:
I am creating a new windows service and I would like to control its Recovery
property. On a system administrator level the Recovery property is found in
Control Panel -> Administrative Tools -> Services -> Service Properties
(right click on a service) -> Recovery tab [in the ClipBook Properties
(Local Computer) dialog box] -> First failure, Second failure properties.

Would anyone know if I can (and how) control First, Second Failure property
programmatically instead of going to the Administrative tools? Or would
anyone know how to deal with this automatically when installing or starting
the windows service?

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top