Is there any way to enable and disable a windows service using batch files. I am talking of changing the startup type of the services i.e. enabling and disabling and not starting and stopping using Net Start and Net Stop commands.
In order to stop the service via batch script: Open cmd as administrator. Run this command: NET STOP <SERVICE_NAME>
sc config <service_name> start= disabled
This command has a number of functions but one is to determine the status of a service at system startup. A service can be set to run automatically, manually or not at all. The commands are
sc config ServiceName start= flag
Here ServiceName is the name of the service and flag has one of the values auto, demand. or disabled . For example, to set a service to run manually the command is
sc config ServiceName start= demand
Note that there must be a space after the equals sign. The correct value for the parameter ServiceName may not always be obvious and the next command can be used to find it for all services.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With