@echo off rem 停止守护.bat - stop the keep-alive guard (the web service itself stays running) rem Finds the wscript.exe whose command line contains this VBS name and kills it. setlocal set "MATCH=保持Web服务常开.vbs" set "FOUND=" for /f "tokens=2 delims==" %%a in ('wmic process where "name='wscript.exe'" get processid /value 2^>nul ^| find "="') do ( set "PID=%%a" setlocal enabledelayedexpansion for /f "usebackq delims=" %%c in (`wmic process where "processid=!PID!" get commandline /value 2^>nul ^| find "="`) do ( echo %%c | find "!MATCH!" >nul && ( taskkill /F /PID !PID! >nul 2>&1 echo Stopped guard PID !PID! set "FOUND=1" ) ) endlocal ) if not defined FOUND echo Guard not found (maybe already stopped). echo. echo Web service on port 8000 keeps running. To stop it too, run: echo taskkill /F /PID (pid shown by: netstat -ano | findstr :8000) pause