Search code examples
windowsservicecommand-line

Is there a commandline option to modify service properties?


I'm working on a script, which should switch between two services: switch one on an the other off and vice versa.

In top of that, I would like to avoid both services being started at the same time, therefore I'm thinking of modifying the properties of the service: I would like to modify the startup type from automatic to disabled and vice versa.

Is this possible and how?


Solution

  • I found the solution, using sc:

    sc config Own_Server1 start=auto
    sc config Own_Server2 start=disabled