I am trying to create a script that checks if the service Print Spooler is running or not.
The commands to start and stop, and check the status are listed below.
sc start Spooler # Starts service sc stop Spooler # Stops service sc query Spooler # Returns status of Spooler I wanted to hide the output of these commands from the user.
I wanted to check if the service is running.
If yes, then echo to user "Print Spooler already running." and then pause before close.
If no, then echo "Service stopped" then start the service and echo "Service starter" and then pause before close.
Any help will be appreciated.