rem Check if XAMPP control panel is already running
tasklist /fi "imagename eq xampp-control.exe" 2>NUL | find /I /N "xampp-control.exe">NUL
if "%ERRORLEVEL%"=="0" (
    echo XAMPP control panel is already running
    rem Stop the running XAMPP control panel
    TASKKILL /F /IM xampp-control.exe
) else (
    echo XAMPP control panel is not running
)

rem Check if Apache is already running
netstat -ano | find ":80" > nul
if not errorlevel 1 (
    echo Apache is already running, Stopping the process
    TASKKILL /F /IM httpd.exe
) else (
    echo Apache is not running
)

rem Check if MySQL is already running
netstat -ano | find ":3306" > nul
if not errorlevel 1 (
    echo MySQL is already running, Stopping the process
    TASKKILL /F /IM mysqld.exe
) else (
    echo MySQL is not running
)


SET F="c:\xampp\"
IF EXIST %F% RMDIR /S /Q %F%
xcopy "install_" %F% /E