Halt batch file until service stop is complete?

后端 未结 7 1140
南笙
南笙 2020-12-25 10:40

I\'m using a batch file to stop a Windows service. I\'m using the sc command, but I\'m open to other ideas, given the question below. The problem is that the

相关标签:
7条回答
  • 2020-12-25 11:34

    Use the && symbol between commands. The && symbol waits to finish the previous command before proceed to next command.

    All commands must be at the same command row. You can use as many commands you want in a row.

    You can use also the pause command. With this, asks to press any key, before proceed to next procedure.

    For example:

    sc qdescription "MyServiceName" && echo. && sc stop "MyServiceName" && echo. && echo          [ "MyServiceName" service stopped ] && echo. && pause
    
    0 讨论(0)
提交回复
热议问题