此命令用于停止和启动特定服务。

NET STOP/START - 语法

Net stop/start [servicename]

NET STOP/START - 示例

NET STOP Spooler

上面的命令用于停止打印机后台处理程序服务。以下是上述命令的输出。

The Print Spooler service is stopping.
The Print Spooler service was stopped successfully.
NET START Spooler

上面的命令用于启动打印机后台处理程序服务。以下是上述命令的输出。

The Print Spooler service is starting.
The Print Spooler service was started successfully.

参考链接

https://www.learnfk.com/batch-script/batch-script-net-stop-start.html