After running:
setup_xampp.batIt works ok: When I unpack the portable version and run it for the first time.
Then I'll end it ...
It displays the following error: when I start XAMPP faulty (quit), third (and quit), fourth (and quit), etc.
I using portable version and this is my scripts for running/ending:
Running script:- Code: Select all
@echo off
start "TEMP" call setup_xampp.bat
start "TEMP" xampp-control.exe
%windir%\system32\ping.exe 127.0.0.1 -n 5 >nul 1>nul 2>nul
set "container=notepad.exe,cmd.exe"
for %%i in (%container%) do (
for /f "tokens=2 delims=," %%a in ('tasklist /fi "imagename eq %%i" /v /fo:csv /nh ^| findstr /r "TEMP"') do taskkill /pid %%a
)
... To keep the command line windows open, I will name them "TEMP" and then kill them.
Exit script:- Code: Select all
@echo off
for %%f in ("*stop*.bat") do (
echo %%f|findstr /i "apache mysql" >nul
if not errorlevel 1 (
start "TEMP" /min call %%f
)
)
%windir%\system32\ping.exe 127.0.0.1 -n 5 >nul 1>nul 2>nul
set "container=notepad.exe,cmd.exe"
for %%i in (%container%) do (
for /f "tokens=2 delims=," %%a in ('tasklist /fi "imagename eq %%i" /v /fo:csv /nh ^| findstr /r "TEMP"') do taskkill /pid %%a
)
start "" ".\apache\bin\pv.exe" -f -k httpd.exe -q
start "" ".\apache\bin\pv.exe" -f -k mysqld.exe -q
%windir%\system32\taskkill.exe /im "httpd.exe" /f>nul 1>nul 2>nul
%windir%\system32\taskkill.exe /im "mysqld.exe" /f>nul 1>nul 2>nul
%windir%\system32\taskkill.exe /im "conhost.exe" /f>nul 1>nul 2>nul
... Sometimes not all services end as they should, so I defined it in three different ways.
And xampp-control.ini have add:- Code: Select all
[Autostart]
Apache=1
MySQL=1
FileZilla=0
Mercury=0
Tomcat=0
... for automatically start Apache and MySQL (Because I have a portable version, I don't want to install and running as services.).