How does Win7 use the command line to start and stop the Windows service program

  

There are many ways to start the stop service program:

Some programs themselves provide a setting interface, which can be set to start and stop; Some third-party programs can be used to control the start and stop, such as programs such as certain guards; you can also specify the service program to start and stop through the service management of windows system; however, these methods are too troublesome to operate, if you need to switch frequently If the startup stops, the above operation modes are a bit confusing, and it is very convenient to start and stop through the command line. Using the command line is also very simple, let's get into the actual operation.

The method/step is as follows:

1. Right click on the desktop <; Computer> Select “Manage” menu item.

2. After clicking the “Manage” menu, the computer management window will open. In the tree list on the left, click the “Services” node. The right side of the window is a list of system service items, with service name, service description, status, etc., where you can terminate the service and adjust the service startup mode. Below, we take the "MSSQLSERVER" service in the red circle in the figure as an example.

3. After selecting the service in the service list, click the right mouse button and select the “Attributes” menu in the pop-up menu to open the Properties window.

4, the purpose of opening the property window, mainly to get the service name, because the name seen in the list is called "display name", when you use the command line operation must specify the service name. In the red circle of the figure, this name can be selected with the mouse, press the shortcut key Ctrl+C to copy to the system clipboard for later use. Windows10 tutorial

5, with any editor that can edit the text, the system comes with a notepad, open Notepad, paste the service name just copied to the text.

6. Add the rest of the order. Start the service with the command: NET STAR, stop the command with the command: NET STOP, supplemented in front of the service name. Start and stop respectively create a text to control start and stop.

7. Save the document in .bat format. Click the File menu in the Notepad menu and select Save. In the pop-up Save dialog box, note: Set the save type to All Files so that you can name the file suffix yourself. Of course, you can also save the file extension to the resource manager and change it to .bat. In this way, the service command line files for starting and stopping are all ready, and the service can be started and stopped conveniently.

Copyright © Windows knowledge All Rights Reserved