Unable to run batch file from Metatrader

Back to topics list To post a new topic, please log in or register
avatar
14
ForexTaurus 2015.04.19 13:08
 

I am able to run a batch file from the command prompt just fine  BUT when I try and run from Metatrader I get Error 2 Code.

MQL4 Script:

#import "shell32.dll"

int ShellExecuteA(int hWnd, string Verb, string File, string Parameter, string Path, int ShowCommand);

#import int r=ShellExecuteA(0, "Open", "C:\Users\Administrator\Tools\send.bat", "", "", 1);

if (r <= 32){ Alert("Shell failed: ", r); return(false); } 

 

Like I said, running the .bat file or using command prompt, just fine. MQL4 Script does not.  I have tried various variations of the above, like "Run" instead of "Open", cmd.com, etc.  same error 2.

Has anyone come across this? 

avatar
13000
WHRoeder 2015.04.19 13:36 #
 
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2.  int r=ShellExecuteA(0, "Open"
    Since February 3, 2014 (Build 600) All strings are Unicode.
  3. ForexTaurus: Has anyone come across this? 
    Six days ago: Unable to run batch file - MQL4 forum
avatar
21
CristianoKonrad 2015.05.12 21:26 #
 
.
Back to topics list  

To add comments, please log in or register