Halt batch file until service stop is complete?

后端 未结 7 1263
南笙
南笙 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:16

    sc stop webdriveservice
    :loop
    sc query webdriveservice | find "STOPPED"
    if errorlevel 1 (
      timeout 1
      goto loop
    )
    

提交回复
热议问题