| 12345678910111213141516171819202122 |
- @echo off
- chcp 65001 >nul
- REM 停止自动任务执行脚本
- echo ================================================
- echo 停止自动任务执行服务...
- echo ================================================
- echo.
- REM 切换到项目根目录
- cd /d %~dp0..
- REM 使用PowerShell查找和停止进程
- echo [查找] 正在查找auto_execute_tasks.py进程...
- powershell -Command "$processes = Get-WmiObject Win32_Process | Where-Object { $_.CommandLine -like '*auto_execute_tasks.py*' }; if ($processes) { Write-Host '[找到] 以下进程将被停止:' -ForegroundColor Yellow; $processes | ForEach-Object { Write-Host (' 进程ID: ' + $_.ProcessId); Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }; Write-Host '[完成] 进程已停止' -ForegroundColor Green } else { Write-Host '[提示] 未找到运行中的进程' -ForegroundColor Cyan }"
- echo.
- echo [验证] 再次检查进程状态...
- powershell -Command "$processes = Get-WmiObject Win32_Process | Where-Object { $_.CommandLine -like '*auto_execute_tasks.py*' }; if ($processes) { Write-Host '[警告] 仍有进程在运行,请手动在任务管理器中结束' -ForegroundColor Red } else { Write-Host '[确认] 所有进程已停止' -ForegroundColor Green }"
- echo.
- pause
|