Command:
C:\Users\Scrillex>for /L %a in (0,0,0) do (netstat -an|find "4016" & ping 1.1.1.1 - n 1 -w 1000 >nul)
Output:
C:\Users\Bojan>(netstat -an | find "4016" & ping 1.1.1.1 -n 1 -w 1000 1>nul)
TCP 0.0.0.0:4016 0.0.0.0:0 LISTENING
TCP [::]:4016 [::]:0 LISTENING
C:\Users\Bojan>(netstat -an | find "4016" & ping 1.1.1.1 -n 1 -w 1000 1>nul)
TCP 0.0.0.0:4016 0.0.0.0:0 LISTENING
TCP [::]:4016 [::]:0 LISTENING
C:\Users\Bojan>(netstat -an | find "4016" & ping 1.1.1.1 -n 1 -w 1000 1>nul)
TCP 0.0.0.0:4016 0.0.0.0:0 LISTENING
TCP [::]:4016 [::]:0 LISTENING
^C
TCP 0.0.0.0:4016 0.0.0.0:0 LISTENING
TCP [::]:4016 [::]:0 LISTENING
C:\Users\Bojan>(netstat -an | find "4016" & ping 1.1.1.1 -n 1 -w 1000 1>nul)
TCP 0.0.0.0:4016 0.0.0.0:0 LISTENING
TCP [::]:4016 [::]:0 LISTENING
C:\Users\Bojan>(netstat -an | find "4016" & ping 1.1.1.1 -n 1 -w 1000 1>nul)
TCP 0.0.0.0:4016 0.0.0.0:0 LISTENING
TCP [::]:4016 [::]:0 LISTENING
^C
To stop the execution of this single line script use CTLR-C.