CODE: [Copy to clipboard]for /F "skip=4 tokens=3 delims=: " %%i in ('netstat -ano') do if %%i==8000 goto :eof