Start :
:################################################# #######################
:# 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 (c)2010
:################################################# #######################
@echo off
color 3
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%" 2>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 2>nul
del AIONEmulator\usr\local\mysql\data\mysql.pid 2>nul
: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" 2>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:3316" 2>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 3316 is free - OK to run MySQL server
if %pass2%==found echo Another server is running on port 3316 cannot run MySQL server
echo.
goto END
:NOTFOUND
echo Port 8096 is free - OK to run server
echo Port 3316 is free - OK to run server
rem ## Find first free drive letter
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 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 starting ....
:next2
home\admin\program\unidelay.exe
if NOT exist usr\local\mysql\data\mysql.pid goto :next2
echo.
echo The Apache server is working on disk %Disk%:\ [http/127.0.0.1]
echo.
echo To open site type
into a browser
echo.
echo The MySQL server is working on disk %Disk%:\ [port 3316]
echo.
echo Checking MySQL Database for Errors ...
\usr\local\mysql\bin\mysqlcheck.exe --defaults-file=/usr/local/mysql/my.cnf --user=root --password=aion --all-databases --silent --force --analyze --optimize --check --auto-repair --use-frm
echo.
goto :END
:RUNNING
CLS
echo.
echo This Apache server is already running.
echo You can stop the server using server_stop.bat
:END
echo.
rem pause
rem ## Return to caller
popd
Stop :
:################################################# ######################
:# File name: server_stop.bat
:# Edited Last By: Mike Gleaves (ric)
:# V 1.0 20-9-2008
:# Comment: Run multi-Apache servers on same PC. Apache 2.2.9 core
:# modified by Novo (c)2010
:################################################# #######################
@echo off
color 3
rem ## Save return path
pushd %~dp0
rem ## Check to see if already stopped
if NOT exist AIONEmulator\usr\local\apache2\logs\httpd.pid goto :ALREADYKILLED
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 files
del AIONEmulator\usr\local\apache2\logs\httpd.pid >NUL
del AIONEmulator\usr\local\mysql\data\mysql.pid >NUL
goto :ALREADYKILLED
rem ## It is running hence shut server down
:RUNNING
rem ## Get drive letter
SET /P Disk=<AIONEmulator\usr\local\apache2\logs\drive.tx t
rem ## Remove pid file server was closed
del AIONEmulator\usr\local\mysql\data\mysql.pid >NUL
rem ## Kill MySQL server
AIONEmulator\usr\local\mysql\bin\mysqladmin.exe --port=3316 --user=root --password=aion shutdown >NUL
rem ## Kill Apache process and all it's sub-processes
SET killstring= -t "%pid%"
AIONEmulator\home\admin\program\pskill.exe Apache_16.exe c
echo MySQL Server stopped
echo Apache Server stopped
rem ## Remove pid file
del AIONEmulator\usr\local\apache2\logs\httpd.pid >NUL
rem ## Remove disk file
del AIONEmulator\usr\local\apache2\logs\drive.txt >NUL
rem ## Kill drive
subst %Disk%: /D >NUL
goto :END
:ALREADYKILLED
echo MySQL Server already stopped
echo Apache Server already stopped
:END
echo.
ause
rem ## Return to caller
popd
Einfach copy pasten dann die endung als bat speichern
mfg