Change Startup Type of Windows Service
I was wondering if anyone knows if it possible to change the startup type of a service programatically, either within the service itself or using a service conrtoller?
Thanks
Ryan
I was wondering if anyone knows if it possible to change the startup type of a service programatically, either within the service itself or using a service conrtoller?
Thanks
Ryan
Hi Ryan,
Service startup type is set during installation (see
ServiceInstaller.StartType).There is currently no managed way to
change this after installation.
However you can change it programmatically in code:
using System; public enum ServiceStart public class ServiceController2 : System.ServiceProcess.ServiceController public ServiceStart ServiceStart |