@echo off cd %~dp0 set PROJECT_PATH=%~dp0 set KEYWORD="%PROJECT_PATH%yii" queue/listen rem @echo %KEYWORD% @echo ÕýÔÚ¼ì²é½ø³Ì... wmic process where name="php.exe" get CommandLine /value | findstr "%KEYWORD%" >nul if %errorlevel% equ 0 ( goto end ) else ( goto start ) :start @echo ÕýÔÚÆô¶¯½ø³Ì... start /b yii queue/listen 1 @echo ½ø³ÌÒÑÆô¶¯£¬ÇëÎð¹Ø±Õ±¾´°¿Ú£¡ goto end :end