Page 1 of 1

Looking for "xampp_restart_services.exe"

PostPosted: 05. September 2004 12:17
by mengland
Hello,

Summary

I'm looking for a "xampp_restart_services.exe"-type mechanism that will stop any currently running apache-or-mysql Windows services and then start/restart them. Anything exist today? If not, can this be a feature request for future revs?

Details

While configuring my XAMPP server (mostly for Apache configuration changes), I often restart Apache (and along with it Mysql) by using the xampp_stop.exe and xampp_start.exe in succession.

2 problems:
1) these .exe files only control the non-Windows-service flavors of the Apache/Mysql processes
2) I'd rather just run one script/executable that both stops and then starts xampp (both Apache and Mysql), probably call it "restart".

-Matt

PostPosted: 05. September 2004 13:21
by Wiedmann
xampp_restart.bat
Code: Select all
@echo off

echo stopping Apache service...
net stop Apache2 >nul 2<&1
if errorlevel 1 (
   echo Apache service could not be stopped / was not started.
) else (
   echo Apache service is stopped.
)
echo.

echo stopping MySQL service...
net stop MySQL >nul 2<&1
if errorlevel 1 (
   echo MySQL service could not be stopped / was not started.
) else (
   echo MySQL service is stopped.
)
echo.

echo starting Apache service...
net start Apache2 >nul 2<&1
if errorlevel 1 (
   echo Apache service could not be started / is not installed.
) else (
   echo Apache service is started.
)
echo.

echo starting MySQL service...
net start MySQL >nul 2<&1
if errorlevel 1 (
   echo MySQL service could not be started / is not installed.
) else (
   echo MySQL service is started.
)
echo.