NetEaseDSMonitor/start_monitor.cmd

44 lines
1.2 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

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
cd /d "%~dp0"
echo 启动网易大神审核数据看板...
REM 检查Python路径
set PYTHON_PATH=C:\Python39\python.exe
if not exist "%PYTHON_PATH%" (
echo [错误] 未找到Python 3.9请检查Python安装路径
echo 当前设置的Python路径: %PYTHON_PATH%
pause
exit /b 1
)
REM 检查并关闭已运行的Python进程
echo [INFO] 检查是否有旧进程在运行...
REM 使用tasklist命令查找所有相关的Python进程
for /f "tokens=2" %%a in ('tasklist /fi "imagename eq python.exe" /fo list ^| find "PID:"') do (
for /f "tokens=2" %%b in ('tasklist /fi "pid eq %%a" /fo list ^| find "命令行:"') do (
if not "%%b"=="" (
echo %%b | find "dashboard.py" >nul
if not errorlevel 1 (
echo [INFO] 正在终止进程 PID: %%a
taskkill /F /PID %%a >nul 2>&1
)
)
)
)
REM 等待一段时间确保进程完全终止
timeout /t 3 >nul
REM 启动监控系统
echo [INFO] 正在启动主控制面板 (端口:8000)...
cd /d "%~dp0"
start "网易大神审核数据监控系统" /b "%PYTHON_PATH%" dashboard.py
REM 等待1秒确保程序启动
timeout /t 1 >nul
REM 退出当前CMD窗口
exit