根据端口结束进程的BAT
2018-06-13 本文已影响17人
千叶鸟
只有放在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