I need to change the credentials of an already existing Windows service using C#. I am aware of two different ways of doing this.
- ChangeServiceConfig, see ttp://www.pinvoke.net/default.aspx/advapi32.ChangeServiceConfig
- ManagementObject.InvokeMethod using Change as the method name.
Neither seems a very "friendly" way of doing this and I was wondering if I am missing another and better way to do this.