@echo off
set port=8808

set port2=8880
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (
    echo kill the process %%m who use the port 
    taskkill /pid %%m -t -f
    goto start
)
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port2%"') do (
    echo kill the process %%m who use the port2 
    taskkill /pid %%m -t -f
    goto start
)
ping 127.0.0.1 -n 5
start java -jar blct-1.0.jar
exit  
:start
ping 127.0.0.1 -n 5
start java -jar blct-1.0.jar
exit