stop kill network connection using cmd line

C++
FOR /F "tokens=4 delims= " %%P IN ('netstat -a -n -o ^| findstr :8080') DO TaskKill.exe /PID %%P
findstr :8080
TaskKill.exe /PID <value>
%%P instead of %P
FOR /F "tokens=4 delims= " %%P IN ('netstat -a -n -o ^| findstr :8080') DO @ECHO TaskKill.exe /PID %%P
"tokens=4 delims= "
FOR /F ... %variable IN ('command') DO otherCommand %variable...

Source

Also in C++: