@echo off
echo ================================================
set port=8080
netstat -nao|findstr !port!
echo ================================================
for /f "tokens=2,5" %%i in ('netstat -nao^|findstr :%%port%%') do (
::if "!processed[%%j]!" == "" (
if not defined processed[%%j] (
set pname=N/A
for /f "tokens=1" %%p in ('tasklist^|findstr %%j') do (set pname=%%p)
taskkill /pid %%j -t -f
set processed[%%j]=1
)
)
echo "process end!”文章来源地址https://www.toymoban.com/news/detail-493682.html
文章来源:https://www.toymoban.com/news/detail-493682.html
到了这里,关于根据指定端口查询进程id,并杀掉进程的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!