Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Windows Tutorials»How to Start/Stop Windows Service via Command Line

    How to Start/Stop Windows Service via Command Line

    By RahulSeptember 12, 20222 Mins Read

    A Windows service is a background process that runs in the background of your Windows computer. It can run in the system tray, so it can be started and stopped at any time. You can create a Windows service programmatically using the ServiceController object or by using the Windows Services application. A Windows service does not have to start as a result of user action; it can also be started automatically when certain conditions are met, such as when the computer boots, or when an application is launched.

    Advertisement

    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.

    cmd service
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    4 Methods to Check .NET Framework Version on Windows

    Generate the SSH Key Pair on Windows {5 Steps}

    How to Clear the ASP.NET Temporary files in Windows

    View 1 Comment

    1 Comment

    1. Darren on September 11, 2022 3:58 pm

      There is no restart option for sc

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Install PHP 8.2-7.4 on RHEL & CentOS Stream 9
    • How to Install MySQL 8.0 on RHEL & CentOS Stream 9
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.