Unable to run batch file from Metatrader

 

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? 

 
  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
 
.
Reason: