@echo off
setport=8082for /f "tokens=1-5" %%i in('netstat -ano^|findstr ":%port%"')do(echokill the process %%m who use the port
taskkill /pid %%m -t-f
goto q
)
:q
重启脚本
@echo off
setport=9090for /f "tokens=1-5" %%i in('netstat -ano^|findstr ":%port%"')do(echokill the process %%m who use the port
taskkill /pid %%m -t-f
goto start
)
:start
START "app" javaw -jar ****.jar