Scripting WampServer
Posted by: SimonOrangeaid (---.dsl.in-addr.zen.co.uk)
Date: April 10, 2026 12:13AM

Does anyone know how to perform WampServer actions - e.g. switching MariaDB version - in a Windows script (batch or PowerShell).

I have a backup script for all my work, and I want it to be able to switch the MariaDB version, in WAMP, before performing certain actions, then switch back to the original version.

Can you invoke wampmanager.exe with certain command line arguments to perform taks that are avaialble in the WAMP menu? If so, can you tell me how?

Thanks
Simon

Options: ReplyQuote
Re: Scripting WampServer
Posted by: Otomatic (Moderator)
Date: April 10, 2026 10:07AM

I'm afraid that might not be possible.

This is done through a series of steps directly linked to wampmanager.exe.

For example, to upgrade from MariaDB 11.4.10 to MariaDB 12.0.2, the following steps are performed:
[switchMariaDB12.0.2]
Action: ParametersRefresh
Action: run; FileName: "E:/wamp64/bin/php/php8.2.30/php.exe"; parameters: "msg.php refreshLogs alllogs automatic";WorkingDir: "E:/wamp64/scripts"; Flags: waituntilterminated; ShowCmd: hidden
Action: closeservices; Flags: ignoreerrors
Action: service; Service: wampmariadb64; ServiceAction: stop; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "sc.exe"; Parameters: "stop wampmariadb64"; ShowCmd: hidden; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "E:/wamp64/bin/mariadb/mariadb11.4.10/bin/mysqld.exe"; Parameters: "--remove wampmariadb64"; ShowCmd: hidden; Flags: ignoreerrors waituntilterminated
Action: run; FileName: "E:/wamp64/bin/php/php8.2.30/php.exe";Parameters: "switchMariaDBVersion.php 12.0.2";WorkingDir: "E:/wamp64/scripts"; Flags: waituntilterminated
Action: run; FileName: "E:/wamp64/bin/php/php8.2.30/php.exe";Parameters: "switchMariaPort.php 3306";WorkingDir: "E:/wamp64/scripts"; Flags: waituntilterminated
Action: run; FileName: "CMD"; parameters: "/D /C sc create wampmariadb64 binpath=""E:\wamp64\bin\mariadb\mariadb12.0.2\bin\mysqld.exe --defaults-file=E:\wamp64\bin\mariadb\mariadb12.0.2\.\my.ini wampmariadb64"""; ShowCmd: hidden; Flags: waituntilterminated
Action: multi; Actions: mariadb_refresh_start; Flags:appendsection

[mariadb_refresh_start]
Action: run; FileName: "sc.exe"; Parameters: "start wampmariadb64"; ShowCmd: hidden; Flags: waituntilterminated
Action: multi; Actions: refresh_readconfig; Flags:appendsection

[refresh_readconfig]
Action: run; FileName: "E:/wamp64/bin/php/php8.2.30/php.exe";Parameters: "refresh.php";WorkingDir: "E:/wamp64/scripts"; Flags: waituntilterminated; ShowCmd: hidden
Action: RestartReadConfig

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.