I'm capturing the PID in a variable which I kill later
IF NOT "%SERVICE_PID%" == 0 taskkill /pid %SERVICE_PID% /t /f
though everytime I do this in a batch file it makes my computer restart because it kills some system process
the service pid should be a user defined service launched from cmd
I dont understand why it keeps making my machine croak.
When I run "taskkill /pid %SERVICE_PID% /t /f" on the command line it works fine! =/
help!
Setting SERVICE_PID
FOR /F "tokens=4 delims= " %%A IN ('sc queryex myservice ^|FIND "PID"')
DO SET SERVICE_PID=%%A