How to restart service using command prompt?

前端 未结 7 1733
一生所求
一生所求 2020-12-29 04:15

I want to restart Windows service using command prompt in [Icons] section using Inno Setup. Please help me to solve the problem.

相关标签:
7条回答
  • 2020-12-29 05:21

    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.

    0 讨论(0)
提交回复
热议问题