@echo off setlocal enabledelayedexpansion echo Checking if WebWork is already running... :: 查找占用 3000 端口的进程 PID for /f "tokens=5" %%a in ('netstat -ano ^| findstr :3000 ^| findstr LISTENING') do ( set PID=%%a if not "!PID!"=="" ( echo Port 3000 is already in use by PID !PID!. Killing process... taskkill /F /PID !PID! ) ) echo Starting WebWork System... cd ..\backend if not exist node_modules ( echo node_modules not found, installing dependencies... call npm install ) echo Starting Backend Server... start http://localhost:3000 npm start