Answer the question
In order to leave comments, you need to log in
How to write a script so that it waits for the service to stop?
There is a server on which a service sometimes hangs, but with its restart, you have to restart a number of services in a certain sequence. I decided to write a .bat script like this:
Net stop "CSTA Mux"
Net stop "TapiSrv"
Net stop "ProstieZvonkiPanasonicService"
Net stop "TAPIZWE"
Net start "CSTA Mux"
Net start "TapiSrv"
Net start "ProstieZvonkiPanasonicService"
Net start "TAPIZWE "
But the problem is that script execution does not wait for the service to stop or start, but executes a trace. line due to which ProstieZvonkiPanasonicService does not have time to stop and is already receiving a Start command. As a result, it does not work correctly.
How can I write a script to trace. the action was performed only upon successful completion of the previous one?
Options with time and inserting a pause of 10 seconds will not help, because sometimes "ProstieZvonkiPanasonicService" stops in 10 seconds, and sometimes in 120 seconds.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question