Running Mercury as Service

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Running Mercury as Service

Postby michaelhyk » 17. April 2006 15:17


I've created a simple script to run Mercury as a service on my Win2003. These are just methods compiled from other websites and xampp batch files. So the credit goes to them. For those who are interested here it is.

1. First download 2 files from Microsoft "instsrv.exe" and "srvany.exe". Just run a google search. Both are in the "rktools.exe" available for free from Microsoft.

2. Place the files in the same directory as MercuryMail.

3. Create a text file and rename it to "mercury_installservice.bat" or anything you like but must have the ".bat" extension.

4. Cut & paste the following into the new text file. Please take note to leave the \\ as it is or it won't work. Also rename the path to your actual path.

@echo off
echo Installing Mercury as an Service
E:\xampp\MercuryMail\instsrv Mercury E:\\xampp\\MercuryMail\\srvany.exe
echo Now we Start Mercury
net start Mercury

5. Create another text file and rename it to mercury.reg

6. Cut & paste the following into it. Remember to rename the path.

Windows Registry Editor Version 5.00

7. You can now run the batch file.

PS: The service will run without logging onto the system. However you cannot start or stop the Mercury server via Xampp control panel (well, not that I've found out yet). So you have to use the task manager to kill the srvany and mercury process manually.

I just keep this handy cos I always muck up my server testing stuff on it. Hope someone will find it useful.

Cheers, sama sama,
Michael Heng
Posts: 4
Joined: 17. April 2006 14:45
Location: MY CN in AU

Postby ldivinag » 19. April 2006 04:45

have you setup mercury as an STMP server only and it only accepts from LOCALHOST and nothing else?
leo d.
User avatar
Posts: 40
Joined: 19. April 2006 04:18

Postby michaelhyk » 19. April 2006 13:34


I did a quick check and manage to get my mails sent and received internally (Not sure if this is what you're asking). Check out this website to configure it following the tutorials if you haven't
What u need to skip is the MercuryC SMTP Relaying client. You just require the POP3 and SMTP Server. Then set your server ip address as your outgoing SMTP server and incoming POP3 server. Hope this helps. Have fun.

Posts: 4
Joined: 17. April 2006 14:45
Location: MY CN in AU

Postby professionalgeek » 19. April 2006 14:33

Thanks for the post. It's nice not having to log in to start the Mercury Mail. In following your instructions, I did run into a small problem. Basically in the Reg file, you have escaped the quotes around the name of the application. When I copy and pasted this, it didn't create the entry for me in the registry. (I am using XP Home). Here is a reg file that does work (for me):

Windows Registry Editor Version 5.00

Also, if you have an install batch file, you should have a remove one too, especially if you are testing. So here is a mercury_removeservice.bat file:

@echo off
echo Now stopping Mercury
net stop Mercury
echo Now Removing Mercury Service
E:\xampp\MercuryMail\instsrv Mercury REMOVE

Again, thanks.


Posts: 5
Joined: 14. April 2006 16:42
Location: Detroit, MI, USA

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 54 guests