只有放在BAT文件中才可以执行
@echo off
setlocal enabledelayedexpansion
for /f "delims= tokens=1" %%i in ('netstat -aon ^| findstr "0.0.0.0:你的端口 "') do (
set a=%%i
taskkill /f /pid "!a:~71,5!"
)
pause
只有放在BAT文件中才可以执行
@echo off
setlocal enabledelayedexpansion
for /f "delims= tokens=1" %%i in ('netstat -aon ^| findstr "0.0.0.0:你的端口 "') do (
set a=%%i
taskkill /f /pid "!a:~71,5!"
)
pause
本文标题:根据端口结束进程的BAT
本文链接:https://www.haomeiwen.com/subject/ktdseftx.html
网友评论