99Max综合娱乐网站(旧版)

 找回密码
 立即注册
查看: 1159|回复: 1

来个高手帮忙改个bat启动支持网站系统。

[复制链接]

升级   20%

发表于 2010-3-8 17:32:54 | 显示全部楼层 |阅读模式
运行下面的bat会连mysql一起启动,我不想启动mysql,因为我电脑已经装了,请大家帮忙改下,我自己试了一下午了都不行,本人实在太菜了。

:########################################################################
:# File name: server_start.bat
:# Edited Last By: Mike Gleaves (ric)
:# V 1.0 1-10-2008
:# Comment: Run multi-Apache servers on same PC. Apache 2.2.9 core
:# MODIFIED BY NOVO @takeoyasha.com (c)2009
:########################################################################

@echo off

rem ## Save return path
pushd %~dp0

rem ## Check to see if already stopped
if NOT exist AIONEmulator\usr\local\apache2\logs\httpd.pid goto :NOTSTARTED

rem ## It exists is it running
SET /P pid=<AIONEmulator\usr\local\apache2\logs\httpd.pid
netstat -anop tcp | FIND /I " %pid%" >NUL
IF ERRORLEVEL 1 goto :NOTRUNNING
IF ERRORLEVEL 0 goto :RUNNING

:NOTRUNNING
rem ## Not shutdown using server_stop.bat hence delete file
del AIONEmulator\usr\local\apache2\logs\httpd.pid
del AIONEmulator\usr\local\mysql\data\mysql_mini.pid

:NOTSTARTED
set pass1=found
set pass2=found
rem ## Check for another server on this Apache port
netstat -anp tcp | FIND /I "0.0.0.0:8096" >NUL
IF ERRORLEVEL 1 set pass1=notfound

rem ## Check for another server on this MySQL port
netstat -anp tcp | FIND /I "0.0.0.0:3306" >NUL
IF ERRORLEVEL 1 set pass2=notfound

if %pass1%==notfound if %pass2%==notfound goto NOTFOUND
echo.
echo  Both ports need to be free in order to run the servers
if %pass1%==notfound echo  Port 8096 is free - OK to run Apache server
if %pass1%==found echo  Another server is running on port 8096 cannot run Apache server
if %pass2%==notfound echo  Port 3306 is free - OK to run MySQL server
if %pass2%==found echo  Another server is running on port 3306 cannot run MySQL server
echo.
goto END

:NOTFOUND
echo.
echo  Apache Port 8096 is free - Set OK to run server
echo  MySQL  Port 3306 is free - Set OK to run server
echo.
rem ## Find first free drive letter
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do CD %%a: 1>> nul 2>&1 & if errorlevel 1 set freedrive=%%a

rem ## Use batch file drive parameter if included else use freedrive
set Disk=%1
if "%Disk%"=="" set Disk=%freedrive%

rem ## To force a drive letter, remove "rem" and change drive leter
rem set Disk=w

rem ## Having decided which drive letter to use create the disk
subst %Disk%: "AIONEmulator"

rem ## Save drive letter to file. Used by stop bat
(set /p dummy=%Disk%) >AIONEmulator\usr\local\apache2\logs\drive.txt <nul

rem ## Set variable paths
set apachepath=\usr\local\apache2\
set apacheit=%Disk%:%apachepath%bin\Apache_16.exe -f %apachepath%conf\httpd.conf -d %apachepath%.

rem ## Start Apache server
%Disk%:
start %Disk%:\home\admin\program\uniserv.exe "%apacheit%"

rem ## Start MySQL server
start /MIN \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/my.cnf

rem ### Wait for Apache to start
echo  Apache Server is starting ...
:next
home\admin\program\unidelay.exe
if NOT exist usr\local\apache2\logs\httpd.pid goto :next

rem ### Wait for MySQL to start
echo  MySQL Server is starting ...
:next2
home\admin\program\unidelay.exe
if NOT exist usr\local\mysql\data\mysql_mini.pid goto :next2

echo.
echo  Apache server is running on disk %Disk%:\  [http/127.0.0.1:8096]
echo  MySQL  server is running on disk %Disk%:\  [port 3306]
echo.
echo  Set Path to Java Runtime portable ...
set Path="%~dp0AIONEmulator\java portable\JDK\bin";%Path%
echo.
goto :END

:RUNNING
echo  The Apache server is already running.
echo  Stop the server with server_stop.bat

echo.

rem ## Get drive letter

SET /P Disk=<AIONEmulator\usr\local\apache2\logs\drive.txt
echo  Set Path to Java Runtime portable ...
set Path="%~dp0AIONEmulator\java portable\JDK\bin";%Path%

echo.

:END
echo.
echo  The Server should now be started ...
ping 127.0.0.1 -n 5 >nul
rem ## Return to caller
popd
温馨提示:
1. 本站模拟器源于网络,经 99Max.mE 二次开发,仅供个人学习娱乐使用,切勿用于商业用途,否则后果自负!
2. 如需更好体验游戏内容,请前往官方游戏!不具备合法的运营模式,都是强盗,请勿擅自搭建私服!
3. 如本站内容有侵犯您的权益,请发送信息至QQ:372607220 或 EMAIL:372607220@qq.com ,我们会及时删除。

升级   100%

发表于 2010-3-8 20:21:03 | 显示全部楼层
改好了。OK !

:########################################################################
:# File name: server_start.bat
:# Edited Last By: Mike Gleaves (ric)
:# V 1.0 1-10-2008
:# Comment: Run multi-Apache servers on same PC. Apache 2.2.9 core
:# MODIFIED BY NOVO @takeoyasha.com (c)2009
:########################################################################

@echo off

rem ## Save return path
pushd %~dp0

rem ## Check to see if already stopped
if NOT exist AIONEmulator\usr\local\apache2\logs\httpd.pid goto :NOTSTARTED

rem ## It exists is it running
SET /P pid=<AIONEmulator\usr\local\apache2\logs\httpd.pid
netstat -anop tcp | FIND /I " %pid%" >NUL
IF ERRORLEVEL 1 goto :NOTRUNNING
IF ERRORLEVEL 0 goto :RUNNING

:NOTRUNNING
rem ## Not shutdown using server_stop.bat hence delete file
del AIONEmulator\usr\local\apache2\logs\httpd.pid

:NOTSTARTED
set pass1=found
set pass2=found
rem ## Check for another server on this Apache port
netstat -anp tcp | FIND /I "0.0.0.0:8096" >NUL
IF ERRORLEVEL 1 set pass1=notfound

if %pass1%==notfound goto NOTFOUND
echo.
echo  Both ports need to be free in order to run the servers
if %pass1%==notfound echo  Port 8096 is free - OK to run Apache server
if %pass1%==found echo  Another server is running on port 8096 cannot run Apache server
echo.
goto END

:NOTFOUND
echo.
echo  Apache Port 8096 is free - Set OK to run server
echo.
rem ## Find first free drive letter
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do CD %%a: 1>> nul 2>&1 & if errorlevel 1 set freedrive=%%a

rem ## Use batch file drive parameter if included else use freedrive
set Disk=%1
if "%Disk%"=="" set Disk=%freedrive%

rem ## To force a drive letter, remove "rem" and change drive leter
rem set Disk=w

rem ## Having decided which drive letter to use create the disk
subst %Disk%: "AIONEmulator"

rem ## Save drive letter to file. Used by stop bat
(set /p dummy=%Disk%) >AIONEmulator\usr\local\apache2\logs\drive.txt <nul

rem ## Set variable paths
set apachepath=\usr\local\apache2\
set apacheit=%Disk%:%apachepath%bin\Apache_16.exe -f %apachepath%conf\httpd.conf -d %apachepath%.

rem ## Start Apache server
%Disk%:
start %Disk%:\home\admin\program\uniserv.exe "%apacheit%"

rem ### Wait for Apache to start
echo  Apache Server is starting ...
:next
home\admin\program\unidelay.exe
if NOT exist usr\local\apache2\logs\httpd.pid goto :next

echo.
echo  Apache server is running on disk %Disk%:\  [http/127.0.0.1:8096]
echo.
echo  Set Path to Java Runtime portable ...
set Path="%~dp0AIONEmulator\java portable\JDK\bin";%Path%
echo.
goto :END

:RUNNING
echo  The Apache server is already running.
echo  Stop the server with server_stop.bat

echo.

rem ## Get drive letter

SET /P Disk=<AIONEmulator\usr\local\apache2\logs\drive.txt
echo  Set Path to Java Runtime portable ...
set Path="%~dp0AIONEmulator\java portable\JDK\bin";%Path%

echo.

:END
echo.
echo  The Server should now be started ...
ping 127.0.0.1 -n 5 >nul
rem ## Return to caller
popd
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|99Max综合娱乐网站(旧版) ( 沪ICP备11024206号-1 )

GMT+8, 2025-4-9 10:51 , Processed in 0.231262 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表