We can start/stop/restart any Windows service in two ways. One is to use of Windows graphical user interface, which is an easier option. Do you know that these services can also be managed via a command line interface? Yes, it can be. In this tutorial, we will discuss an option to manage a service state via the command-line interface.

How to Start/Stop a Windows Service using CLI

Windows Service Controller (sc) is a command line utility that communicates with Service Control Manager and services. It also provides you options to create/delete a Windows service and/or manage its state. You can also chagne the startup type of service. Use the following commands to start or stop a Windows service:

Start Service: sc start ServiceName Stop Service: sc stop ServiceName

You can also change the Windows service startup type using the 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

Conclusion

This tutorial helped you to manage the Windows service state using the command line interface. Additionally provides you info about changing service startup type in the Windows system.