Window Nginx管理控制bat脚本

<span style="font-family: 'Microsoft YaHei', 微软雅黑, SimHei, tahoma, arial, helvetica, sans-serif;">@echo off

echo ==================begin========================

cls 

color 0a 

TITLE Nginx 管理程序 Power By wenluoxicheng

CLS 

ECHO. =============================================

ECHO. *** Nginx 管理程序 Power By wenluoxicheng ***  

ECHO. ============================================

:MENU 

ECHO. * nginx 进程list *  

tasklist|findstr /i "nginx.exe"

if ERRORLEVEL 1 (echo nginx.exe不存在) else (echo nginx.exe存在)

ECHO. 

ECHO.  [1] 启动Nginx  

ECHO.  [2] 关闭Nginx  

ECHO.  [3] 重启Nginx  

ECHO.  [4] 退 出 

ECHO. 

ECHO.请输入选择项目的序号:

set /p ID=

IF "%id%"=="1" GOTO start 

IF "%id%"=="2" GOTO stop 

IF "%id%"=="3" GOTO restart 

IF "%id%"=="4" EXIT

PAUSE 

:start 

call :startNginx

GOTO MENU

:stop 

call :shutdownNginx

GOTO MENU

:restart 

call :shutdownNginx

call :startNginx

GOTO MENU

:shutdownNginx

ECHO. 

ECHO.关闭Nginx...... 

taskkill /F /IM nginx.exe > nul

ECHO.OK,关闭所有nginx 进程

goto :eof

:startNginx

ECHO. 

ECHO.启动Nginx...... 

echo "start '' nginx.exe"

start "" nginx.exe

        GOTO MENU

ECHO.OK</span>

猜你喜欢

转载自wenluoxicheng.iteye.com/blog/2305679
今日推荐