I'm trying to kill process on 6373
port (as suggested here) with following code:
FOR /F "tokens=5 delims= " %P IN ('netstat -a -n -o ^| findstr :6373') DO TaskKill.exe /F /PID %P
and this works if I run it from cmd
on local machine...
But got
6373') was unexpected at this time.
Process exited with code 255
if I try to run it as build-step on TeamCity
Windows
agent
I tried tokens=4
instead of tokens=5
as well as %%P
instead of %P
, but got same result. Can anyone point on my mistake?