简单可用,复杂不可用
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user