@ECHO OFF
:start
TITLE nginx-0.8.31，选择7关闭
@echo 1、启动nginx (start nginx)
@echo 2、停止nginx (nginx -s stop)
@echo 3、退出nginx (nginx -s quit)
@echo 4、重开nginx (nginx -s reopen)
@echo 5、重载nginx (nginx -s reload)
@echo 6、关闭nginx (kill /im nginx.exe)
@echo 7、关闭并退出 (kill /im nginx.exe)
set /p choice=请输入选择:
if %choice%==1 goto choice1
if %choice%==2 goto choice2
if %choice%==3 goto choice3
if %choice%==4 goto choice4
if %choice%==5 goto choice5
if %choice%==6 goto choice6
if %choice%==7 goto choice7
exit

:choice1
cls
%~d0
cd %~dp0
cd nginx-0.8.31
echo 启动nginx-0.8.31，请启动php-cgi,或者选择7关闭nginx
start ..\nginx-0.8.31\nginx
goto start

:choice2
cls
%~d0
cd %~dp0
cd nginx-0.8.31
echo 停止nginx-0.8.31
..\nginx-0.8.31\nginx -s stop
goto start

:choice3
cls
%~d0
cd %~dp0
cd nginx-0.8.31
echo 退出nginx-0.8.31
..\nginx-0.8.31\nginx -s quit
goto start

:choice4
cls
%~d0
cd %~dp0
cd nginx-0.8.31
echo 重开nginx-0.8.31
..\nginx-0.8.31\nginx -s reopen
goto start

:choice5
cls
%~d0
cd %~dp0
cd nginx-0.8.31
echo 重载nginx-0.8.31
..\nginx-0.8.31\nginx -s reload
goto start

:choice6
cls
%~d0
cd %~dp0
cd nginx-0.8.31
echo 关闭nginx-0.8.31，选择1启动nginx，或者关闭窗口
taskkill /f /im nginx.exe
goto start

:choice7
cls
%~d0
cd %~dp0
cd nginx-0.8.31
taskkill /f /im nginx.exe
exit
