📜  服务重启命令 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:52.026000             🧑  作者: Mango

代码示例1
You can use sc start [service] to start a service and sc stop [service] to stop it. With some services net start [service] is doing the same.

But if you want to use it in the same batch, be aware that sc stop won't wait for the service to be stopped. In this case you have to use net stop [service] followed by net start [service]. This will be executed synchronously.