geely-kaipiao/proxy/cleanup_8080.bat
2026-05-25 14:29:42 +08:00

29 lines
824 B
Batchfile

@echo off
echo ================================================
echo 清理8080端口进程脚本
echo ================================================
echo.
:: 查找并终止使用8080端口的进程
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8080" ^| findstr LISTENING') do (
echo 终止进程: PID %%a
taskkill /F /PID %%a
)
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8080" ^| findstr ESTABLISHED') do (
echo 终止进程: PID %%a
taskkill /F /PID %%a
)
:: 查找并终止Python代理进程
for /f "tokens=2" %%a in ('tasklist ^| findstr python.exe') do (
taskkill /F /PID %%a
echo 终止Python进程: PID %%a
)
echo.
echo ================================================
echo 清理完成
echo ================================================
pause