Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: If Then Start Stop Service from Command Line

18 May 2015   #1

Windows 8.1 Professional 64bit
If Then Start Stop Service from Command Line

Is there a away from the windows 7 command line I can check if a specific service is running and if it is stop it? If not specifically stop it is it possible to just check if its there?

My System SpecsSystem Spec
18 May 2015   #2

W7 home premium 32bit/W7HP 64bit/w10 tp insider ring

Dont know of a command line script.

i know that running services can be checked in the Task Manager (ctrl+alt+delete).

You can also view and stop them from
Control Panel>Admin tools>Services>rightclick properties.


Attached Thumbnails
If Then Start Stop Service from Command Line-services.png  
My System SpecsSystem Spec
18 May 2015   #3

Windows 7 Ultimate x64

You can use the SC command for this purpose to manage services. It supports a wide range of operations on system services, but particularly useful for you question are sc query and sc stop. Use them like this:

SC QUERY <service name>
To get a brief information about the service. Weather or not it's running will be displayed there.

SC STOP <service name>
This will stop the service, if possible. If it's wasn't running it will simply show an error message, but it doesn't does anything else, so issuing this one right away without querying will do no harm at all.

SC START <service name>
Just for completeness, this will, as the name suggest, start a service again.

Note that for starting and stopping services you need to have administrative privileges. Querying state can be done by plain users too. Also, the <service name> you need to enter is each service internal name, NOT the display name shown in control panel. Look at the screenshot by torchwood, where the properties dialog shows both.
My System SpecsSystem Spec

19 May 2015   #4

Windows 8.1 Professional 64bit

Thank you for the responses. Alejandros85, thanks, I did not know about the query part of SC.
My System SpecsSystem Spec

 If Then Start Stop Service from Command Line

Thread Tools

Similar help and support threads
Thread Forum
MSDOS Command to Start Windows Service
Hello, I'm looking to automate a application access which in turn requires a windows service to start. for this I want to put commands in a batch file and use it when I want to open the application. For example - I have Cisco AnyConnect VPN client application which I use at home...
General Discussion
I cant start or stop service
Hello guys, i have a problem. I connected from teamviwer in china, where is troublemaker computer. I have program UPS Confing (battery) and when i run it windows show me dialog box UPS Conf has stopped working. I open Task manager, service tab and i found service ADI UPS- is stopped , group N/A....
General Discussion
The dependency service or group failed to start- Command Prompt
Hi everyone! :D I'm having a pretty big problem on my laptop- I can't connect to the internet and when I try to connect in the network and sharing centre it simply says 'The dependency service or group failed to start' and I am unable to connect to the internet (Using wi-fi). There's a lot...
General Discussion
net start command line issue - 64bit issue?
I am trying (in vain) to issue a net start command "net start - "C:\Program Files (x86)\uTorrent\utorrent.exe", on the command line. The error message is "the filename, directory name or volume label syntax is incorrect". I believe the 3 details are correct, as i am looking at the utorrent.exe file...
General Discussion
Stop Command Line Window Message From Closing
I have a problem running a task with Task Scheduler. The task doesn't run. I have to debug it. When I try to make it run from the app a message appears on a command line message, but it appears and disappears so quickly that I can't read it. To fix the problem I need to read it to know what is...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:54.
Twitter Facebook Google+