@echo off set port=12367 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 identify-standalone.jar
重启
@echo off set port=12367 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 START "app" javaw -jar identify-standalone.jar
开始
标签:脚本,set,off,启动,%%,win,jar,echo,port From: https://www.cnblogs.com/wangbiaohistory/p/17228387.html