0

I am writing a service, in which I want to restrict users from modifying service startup type. How do I do? I have attached a windows service which grays out the startup option.

WinDefend - Service Properties:

WinDefend - Service Properties

6
  • You would have to start a user level service as a system user. I cannot in good conscious help you with this endeavor. Commented Jun 17 at 10:58
  • Is "graying out" the real goal? Or is the intent to disable changing the startup type? The Win32 registry has fine-grained security. Just don't give users write access to the startup type.
    – MSalters
    Commented Jun 17 at 12:16
  • Yes, the goal is to restrict user to modify the service startup type. For now, I know the key can be restricted so when user tries to modify the service startup it will show up error. But is there a way to gray out via API like restricting to control the service status (stop, start and pause)
    – pari.dev
    Commented Jun 17 at 13:30
  • AFAIK, there is no public API to allow a user service to grey out its startup type. Microsoft does that for their own system services so users don't mess up the OS. If you don't want users to stop/pause your service, you can handle that in your service code by omitting the SERVICE_ACCEPT_PAUSE_CONTINUE and SERVICE_ACCEPT_STOP controls when calling SetServiceStatus(). Commented Jun 17 at 17:32
  • I also want user to not modify the service startup type too
    – pari.dev
    Commented Jun 18 at 4:28

0

Browse other questions tagged or ask your own question.