Files
AIclinicalresearch/查看端口占用.bat
AI Clinical Dev Team 16b975c340 fix: add service management scripts for port conflicts
New tools:
- 鍋滄鎵€鏈夋湇鍔?bat - Stop all services
- 鏌ョ湅绔彛鍗犵敤.bat - Check port usage
- 閲嶅惎鏈嶅姟.bat - Restart services
- 蹇€熶慨澶?绔彛鍗犵敤.md - Troubleshooting guide

These scripts help resolve:
- EADDRINUSE error (port 3001 already in use)
- ENOBUFS error (network connection issues)
- Timeout errors (backend not responding)
2025-10-10 21:23:51 +08:00

51 lines
1.1 KiB
Batchfile
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
echo ========================================
echo 查看端口占用情况
echo ========================================
echo.
echo [端口 3001 - 后端服务]
netstat -ano | findstr :3001
if errorlevel 1 (
echo ✅ 端口3001空闲
) else (
echo ⚠️ 端口3001已被占用
echo.
echo 占用进程详情:
for /f "tokens=5" %%a in ('netstat -aon ^| findstr :3001 ^| findstr LISTENING') do (
tasklist | findstr %%a
)
)
echo.
echo [端口 3000 - 前端服务]
netstat -ano | findstr :3000
if errorlevel 1 (
echo ✅ 端口3000空闲
) else (
echo ⚠️ 端口3000已被占用
echo.
echo 占用进程详情:
for /f "tokens=5" %%a in ('netstat -aon ^| findstr :3000 ^| findstr LISTENING') do (
tasklist | findstr %%a
)
)
echo.
echo [所有Node.js进程]
tasklist | findstr node.exe
if errorlevel 1 (
echo 没有运行中的Node进程
)
echo.
echo ========================================
echo 检查完成
echo ========================================
echo.
echo 如需停止服务,请运行: 停止所有服务.bat
echo.
pause