cmdshellexecutemql5shellexecuteex

cmd command in ShellExecuteW


I want to delete a file using cmd comment. I run the code in MQL5 language from my EA. Here's the code that I used

string PathReportBacktest=sTerminalTesterDataPath+"\\MQL5\\Files\\Reports\\"+StrategyCategory+"\\"+StrategyName+"\\"+ FileName +" Report.xml";

ShellExecuteW(0, "open", "cmd", "/C del "+PathReportBacktest, "", 0)

I tried to use the show window option and I found that the cmd opens up and closed without doing anything.


Solution

  • 2 things that I do to fix the problem,