启动脚本
@echo off
START "app" javaw -jar app-0.0.1-SNAPSHOT.jar
停止脚本 自己的端口号
@echo off
set port=9090
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 q
)
:q
重启脚本 两个合并
@echo off
set port=9090
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
)
:start
START "app" javaw -jar app-0.0.1-SNAPSHOT.jar