Start or stop services in Windows command line using the net and sc commands.
You can use the net and sc commands in the Windows command prompt to start and stop services.
The syntax for starting a service using the net command is as follows:
net start 服务名称
For example, to start the Windows Update service, you can use the following command:
net start wuauserv
The syntax for stopping a service using the net command is as follows:
net stop 服务名称
For example, to stop the Windows update service, you can use the following command:
net stop wuauserv
The syntax for starting a service using the sc command is as follows:
sc start 服务名称
For example, to start the Windows update service, you can use the following command:
sc start wuauserv
The syntax for stopping a service using the sc command is as follows:
sc stop 服务名称
For example, to stop the Windows update service, you can use the following command:
sc stop wuauserv
It should be noted that the service name in the above command refers to the name of the service, not the display name. You can use the ‘net start’ or ‘sc query’ command in the command line to view the names of all services.