How to autostart Metatrader (or any program) on a VPS

 

Introduction

I was trying many methods to autostart my VPS. Autostart menu and autologon just didn't work for me. So I had to autostart my terminals under System account, which autologins each time Windows restarted. There is a lightweight utility anyserv.exe, I used it for a long time successfully, untill one day my VPS host's antivirus blocked it as a malware. Though it may be just a false positive, according to VirusTotal. So anyone who is not afraid can try this small utility (see attached files). There's another utility srvinstw, but it didn't work for me - terminals were not starting. So, being unable to use these utils, I've found even more handy utility: AnvirTaskMAnager.

So, now I'm going to give an idea of the easiest way to autostart MetaTrader on a VPS prior to user logon, so our Expert Advisors continue to work after VPS reboots.


What you need

Go to https://www.mql5.com/go?link=http://www.startup-manager-windows.com// or https://www.mql5.com/go?link=https://www.anvir.net// (for russian version) and download AnVir Startup Manager (AnvirTaskManager) ~ 4.5 Mb.

You can open that url directly from your VPS browser. After installing this software on your VPS, open AnVir Startup Manager Settings menu, and click "Run as service" menu item there. Then browse for any executables you need to autostart everytime VPS is rebooted. Tick the checkboxes, press Ok twice and you are done.


Conclusion

Summarizing all the above, now we can have a good sleep at night, not worrying about VPS reboots. This is a very vital nessesity to a trader - even more than a money management - to have a chance to relax... :)

Attachments:
anyserv.zip (49.2 Kb)
srvinstw.zip (28.4 Kb)
 
i have no idea y u need all these things, u can simple add any program or whatever u want, in the startup & it will run when the operating system goes up
 
qjol:
i have no idea y u need all these things, u can simple add any program or whatever u want, in the startup & it will run when the operating system goes up
There's a difference between things in the Startup folder, which only run once a user logs on, versus things which auto-start when the computer boots. If there's a problem with your VPS, and it re-boots, do you want MT4 to restart automatically without manual intervention, or do you want to have to wait until you are in a position to log in to the VPS?

It's possible to set up this sort of thing manually using srvany, but the steps involved are a little fiddly.
 

mr. JJC

Trader108 wrote:


So, now I'm going to give an idea of the easiest way to autostart MetaTrader on a VPS prior to user logon, so our Expert Advisors continue to work after VPS reboots

 
qjol:

mr. JJC

Trader108 wrote:


So, now I'm going to give an idea of the easiest way to autostart MetaTrader on a VPS prior to user logon, so our Expert Advisors continue to work after VPS reboots


mr qjol, I meant that VPS usually do not login automatically after it was rebooted due to maintainiance or anything else. And, as JJС said there's a difference of using Startup folder with or without logging in. When you reboot your PC it always stops loading at the welcome screen, prompting for password. I think, it's a nessessity to use password-protected welcome screen at even private VPS.
 
i think that u r not familiar how servers work, it can be password protected and still load all programs, never mind
 

It's ok, but could you describe how can i do that in more detail? VPS is Win XP. Please share your knowledge. Thanks in advance.

 
Don't you simply need this: Autologon and then put MT4 in your Startup group ?
 

Thanks, but

Autostart menu and autologon just didn't work for me.
- Don't know the reason why.
Besides that, IMHO this greatly reduces security of system, as anyone who knows VPS IP (server employee, or who bruteforcely enumerated it) can get to the workspace freely.
 
Trader108:

Thanks, but


Ah, sorry, missed that. Your OP has gotten me thinking about future strategies around this subject :-) so thanks.
 

Googled this topic last week, as this is something I also need. Found the following:

http://forex-ea-vps.com/component/content/article/36-computing-trends/184-setting-up-a-metatrader-4-expert-advisor-on-a-vps-tutorial

Another one I found:

http://www.cynthia-recommends.info/vps_guide_for_mt4.pdf

In this guide, the author recommends configuring the VPS to auto log in, by modifying the windows registry. Although I couldn't find the "reg_update.reg" download, that is mentioned in the document.

Configuring MT4 to run on start up is also covered, but again, I couldn't find the file "start.cmd" that is mentioned in the document. Apparently this delays the MT4 run by 30 seconds after start up.

I'm using Win 2008 R2 64bit OS on my vps, and MT4 works fine. From what I've seen, I don't need to log in using an administrator pswd on reboot. It goes straight to desktop. I restarted it several times, with MT4 set to run on start up, and it works fine.

If anyone finds the files in the second document, or similar, please let me know, I'd like to see them.

Thanks.

Reason: