A service is used for continuous running processes on any operating system. Generally, it is used for task automation, listening for specific events on a system.
Any Windows system user can stop, start or restart a Service in two ways. You can easily manage the service state using the graphical user interface. In this tutorial, we will discuss about another option to manage the service using the command-line interface.
Start, Stop & Restart Windows Service using Command Line
You can use Windows Service Controller (sc) command line utility for managing services. It provides you options to create/delete a Windows server, or manage service states. You can also change start type of service.
Use one of the below commands to start, stop or restart service
- Start Service:
sc start ServiceName
- Stop Service:
sc stop ServiceName
- Restart Service:
sc restart ServiceName
You can also change the Winodws service startup type using sc command. The following examples will help you to change service startup to manual or disable it.
- Set start type to manual:
sc config ServiceName start=manual
- Disable service:
sc config ServiceName start=disabled
This tutorial helped you to manage Windows service state using command line interface. Additionally provides you info about changing service statup type in Windows system.