Answer the question
In order to leave comments, you need to log in
How to convert cmd/bat to powerShell?
There is a code
SetLocal EnableDelayedExpansion
Set ServiceName=tbupddwu
Net Stop %ServiceName%||(
For /F "tokens=3" %%A In ('SC queryex %ServiceName%^|Find "PID"') Do (
TaskKill /F /T /PID %%A>nul
Ping -n 5 127.0.0.1>nul
)
)
Net start %ServiceName%
Pause&Exit
Answer the question
In order to leave comments, you need to log in
Rewrite. For all his fearfulness, he does quite obvious things - he shoots some service, checks that he is dead, if not - something else brings down, then starts it again - apparently such a cunning restart of the service
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question