shell execuate not executing

 

Dear sir,


I had try to execute the Following Programme

//+------------------------------------------------------------------+
//|                                                            1.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict


#import "shell32.dll"
       int ShellExecuteW(int hWnd,int lpVerb,string lpFile,string lpParameters,string lpDirectory,int nCmdShow);
#import



//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   EventSetTimer(30);
      
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();
      
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
  

  
    ShellExecuteW (0,0,"WindowsApplication100.exe","C:\\Program Files\AUTOTRADER\\projects\\WindowsApplication100\\WindowsApplication100\\bin\\Debug\\","",1);  
  
      
  
  }
//+------------------------------------------------------------------+

But  My Programming is not Running,

When i try to run with this same code for running "Notepad.exe", it is working Fine

I request you to Correct my code,


Thank you

Yours Respectively

Automated Trading and Strategy Testing
Automated Trading and Strategy Testing
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
If your application can run correctly in the Windows Explorer, it could be a dependency related issue. That is, your executable depends on some DLL(s) which is not located at the working directory, current directory and other directories specified in the "PATH" environment variable. 
 
BTW, when you post code in the forum, please use the "SRC" feature of the editor. This time i did it for you :)
 
"C:\\Program Files\AUTOTRADER\\projects\\WindowsApplication100\\WindowsApplication100\\bin\\Debug\\"

Bad path. You have no directory "Program FilesAUTOTRADER" under C:\

It runs notepad because that is in your PATH variable.

 
whroeder1:
"C:\\Program Files\AUTOTRADER\\projects\\WindowsApplication100\\WindowsApplication100\\bin\\Debug\\"

Bad path. You have no directory "Program FilesAUTOTRADER" under C:\

It runs notepad because that is in your PATH variable.



THANK YOU SO MUCH FOR THE PROMPT REPLAY


ONCE AGAIN THANK YOU SIR

Reason: