Autostart script on computer reboot?

 
If my computer reboots due to power failure, I need my MetaQuotes script to restart automatically. This is a script, not an expert.

What command can I add to my Windows->Start folder so that my .ex4 script starts on system start? Does Terminal.exe have a parameter I can pass to specify a script to start? I've tried associating .ex4 files with terminal.exe but that doesn't work.

Any ideas are greatly appreciated.

Thanks!
Alan
 
If my computer reboots due to power failure, I need my MetaQuotes script to restart automatically. This is a script, not an expert.

What command can I add to my Windows->Start folder so that my .ex4 script starts on system start? Does Terminal.exe have a parameter I can pass to specify a script to start? I've tried associating .ex4 files with terminal.exe but that doesn't work.

Any ideas are greatly appreciated.

Thanks!
Alan


Have you looked at any 3rd party products such as winbatch (winbatch.com)? While I haven't actually used it I believe it fits your needs. There may be a free personal version or similar open source projects available.
 
Alan,

For an excellent 3rd party Windows control/scripting utility, you can't go past AutoIT http://www.autoitscript.com/autoit3/

Having said that, I'm not aware of any way to start a script on a chart via command line. This feature is sadly lacking from all that I'm aware of. Basic command line should be Account/Pswd, Profile, Currency Pair, TF, EA (Optional settings file), Script (Optional settings file).

Hopefully someone from MetaQuotes will respond with something a little more hopeful for your plight.

Martin
 
If my computer reboots due to power failure, I need my MetaQuotes script to restart automatically. This is a script, not an expert.

What command can I add to my Windows->Start folder so that my .ex4 script starts on system start? Does Terminal.exe have a parameter I can pass to specify a script to start? I've tried associating .ex4 files with terminal.exe but that doesn't work.

Any ideas are greatly appreciated.

Thanks!
Alan

I may be wrong, but it is my believe that once the script is properly attached to the chart, same as indicator or expert, it will be executed when MT4 is open.
I believe that there is no need to open script separately.
However, after the script is executed it will disconnect because the start() function is not activated by a tick.
So unless it is called from indicator or expert it will be idling.
 
sub,

err, did you try this at all ? I have a connection monitoring script that I need to drag onto a chart at terminal.exe start time. A restart of the MT4 instance does not automatically restart the script - I need to reattach it
 
That's my experience as well: scripts need to be reattached on startup. That's what I'm trying to avoid.

Also, for what it's worth, I have an infinite loop in my script, so it runs just fine so long as the computer is powered on.

Thanks for the feedback...keep it coming!

Alan
 
sub,

err, did you try this at all ? I have a connection monitoring script that I need to drag onto a chart at terminal.exe start time. A restart of the MT4 instance does not automatically restart the script - I need to reattach it

Well, when I got my first build, I believe it was 183, I was playing with the script "Rotate Text" supplied with the platform.
I recall that when I clicked on the file I was asked something like "Are you sure you want to attach script to chart?"
I am not sure about exact wording, however since then I cannot reproduce it.
I was actually expecting this message when I wrote my recent script and was debugging it..
Since my script worked OK I was not concern with the warning message believing that I probably have different property settings somewhere.
If in fact the script cannot be attacher to a chart, same as an indicator or expert, that would be serious BUG!!.
OK Slawa, please explain.
 
That's my experience as well: scripts need to be reattached on startup. That's what I'm trying to avoid.

Also, for what it's worth, I have an infinite loop in my script, so it runs just fine so long as the computer is powered on.

Thanks for the feedback...keep it coming!

Alan


I believe the winbatch stuff will actually record mouse clicks, drags, etc. and replay them. So you can have it record you attaching the scripts and have that job run from your startup menu -- again I haven't used the tool other than as an eval about 5 yrs ago but I believe this should work.

Marc
 
just to re-iterate things said above, I'm positive Auto-it would fill the need, although I am aware something built into the metatrader platform would be more ideal. Autoit is designed to replace repetive windows commands and sequences, it's just a macro program. As long as you can get Auto-it to auto-run on a reboot you should be fine!
 
Well thats as easy as putting the script file in the Startup folder
 
Thanks for all the feedback! I have downloaded AutoIt and will let you know how it goes after I try it out.
Reason: