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