I want to write a batch file that performs the following operations:
- Check if a service is running
- If is it running, quit the batch
- If it is not running, start the service
The code samples I googled so far turned out not to be working, so I decided not to post them.
Starting a service is done by:
net start "SERVICENAME"
- How can I check if a service is running, and how to make an if statement in a batchfile?
- I'm a bit confused. What is the argument I have to pass onto the net start? The service name or its display name?