How can I run a service which has status "stopped" using a
Here is the sample batch (*.BAT) file I use to start my local SQL Server instances (running as Windows services):
Similarly, the following stops them all, one by one:
So, use the NET START|STOP ServiceName command.
According to Larssend answer view this answer with SC description: http://stackoverflow.com/a/133926/1776789. For me it's works fine.
If you're using Powershell then you can use the following commands:
sc doesn't work in powershell straight away as it's aliased to a command called set-content.
You can use
Lists all running services installed on your computer.
Dumps the list of all running services into a file named services.txt in C:.
Lists all stopped services installed on your computer.
Dumps the list of all stopped services into a file named *dis_services.txt* in C:.
Starts a service called [service_name], for example:
Starts the Print Spooler service.
Stops a service called [service_name], for example:
Stops the Print Spooler service.