[XAMPP]How to stop all services (Apache, Mysql) and exit from control panel by just clicking a shortcut.

It's too much hassle to shut down XAMPP.
You need to stop all services like Apache and Mysql before exit from xampp-control.exe
...but, I want quit from all at once.
So I always use this .bat file method.

How to shut down XAMPP with .bat file.


Step1. Create a batch file using Notepad or any other editor.
Step2. Write the code following and save it.


@echo off
call C:\xampp\apache_stop.bat
call C:\xampp\mysql_stop.bat
taskkill /F /IM xampp-control.exe /T
:exit

Step3. Create a desktop shortcut to the batch file.
Step4. Open the shortcut's Properties window.
Step5. Click "Advanced..." and Check "Run as administrator".

All you need is just clicking this shortcut to shut down XAMPP.

What is this batch file doing?


Actually, XAMPP has many *.bat files for shutting down particular services.


call C:\xampp\apache_stop.bat
call C:\xampp\mysql_stop.bat

These lines are stopping Apache and Mysql using XAMPP's batch files.
Batch files are located XAMPP's installation folder, so change path if needed.


taskkill /F /IM xampp-control.exe /T

This line is exiting from control panel.
All comands need administrative rights for running, make sure you run batch file as administrator.