ShellExecuteA(0,"open","cmd.exe","copy \"G:\\teste\\teste.txt\" \"G:\\teste2\"","",0);
-
Since build 600 and Higher (2014.02.03) all strings are Unicode. Wrong call.
Syntax for calling AutoIt compiled Script (.exe) using ShellExecuteW in MT4 EA (Quest) - MQL4 programming forum (2015.04.25)
run a *.bat from EA (Route206) - MQL4 programming forum (2015.10.30)
Execute an exe-file from MQL (Steffen Siegert) - MQL4 programming forum (2016.07.30) -
Open a cmd window and type in "cmd.exe echo xx" and you will know why the call will not work.
-
Since build 600 and Higher (2014.02.03) all strings are Unicode. Wrong call.
Syntax for calling AutoIt compiled Script (.exe) using ShellExecuteW in MT4 EA (Quest) - MQL4 programming forum (2015.04.25)
run a *.bat from EA (Route206) - MQL4 programming forum (2015.10.30)
Execute an exe-file from MQL (Steffen Siegert) - MQL4 programming forum (2016.07.30) -
Open a cmd window and type in "cmd.exe echo xx" and you will know why the call will not work.
Hi! Thanks for the reply.
I changed the call of ShellExecuteA to ShellExecuteW, but it didn't work either. And I "open a cmd window and type in "cmd.exe echo xx"" and I only got was a message about the current windows version, nothing I could make use of to solve my problem:
What am I missing? :|
Hi! Thanks for the reply.
I changed the call of ShellExecuteA to ShellExecuteW, but it didn't work either. And I "open a cmd window and type in "cmd.exe echo xx"" and I only got was a message about the current windows version, nothing I could make use of to solve my problem:
What am I missing? :|
Are you kidding ? The "xx" is to be replaced by your command of course.
Gosh how could I know that? xD
Anyway, it didn't quite improved my situation ^^
P.S: Let's remember, the copy command works in cmd A.w.a. when called from withing a .bat file. It's only when I call it with ShellExecuteW from within the MQL script that nothing happens.
And anyway you are overcomplicating things. A simple junction would suffice to get what you want.
Hmm and what is a junction? xD
The xx did not need to be replaced. "cmd command" only starts a new cmd. Type "help cmd" and read about the /C flag.
Hmmm so it was the /c that was missing :3 I saw in one of the examples in one of the link you provided, but though it was something specific of that case and didn't add it. Thanks! :)
(My gosh, all this trouble because of a missing /c \o/)
Gosh how could I know that? xD
Anyway, it didn't quite improved my situation ^^
P.S: Let's remember, the copy command works in cmd A.w.a. when called from withing a .bat file. It's only when I call it with ShellExecuteW from within the MQL script that nothing happens.
Ok sorry, I misunderstood William's remark.
Hmm and what is a junction? xD

- 2018.05.31
- mikben
- docs.microsoft.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
as noted in this recent thread of mine, I'm trying to create a script that will copy my developed .ex5 files to other terminal's folders. After a failure attempt of doing that with MQL5's own functions, I tried appealing to classic cmd.exe commands.
With that in mind, I successfully created a .bat file that does what I want with the following code:
After, following the example lay down by this thread, I created a MQL5 script with the following code:
And guess what, it didn't work :( What am I doing wrong?