端口号清理bat,拷贝后放到txt文档里把txt改为bat运行即可
@echo off
chcp 65001
set /p port=请输入被占用的端口号:
for /f "delims=" %%a in ('netstat -aon^|findstr %port%') do set process=%%a
for /f "tokens=1,2,4,5,* delims= " %%a in ("%process%") do (
set c1=%%a
set c3=%%b
set c4=%%c
set c5=%%d
set c6=%%e
)
taskkill /pid %c5% /F
echo=
pause
标签:set,%%,占用,清理,echo,txt,端口号
From: https://www.cnblogs.com/YKHan/p/17150083.html