MT5 Auto Start with config.ini via batch file, facing strange problem

 

I have created a batch file for auto startup MT5 and perform a backtest with the following:

"C:\\Program Files\\MetaTrader 5\\terminal64.exe" /portable /config:"C:\\Program Files\\MetaTrader 5\\config.ini"


and the following for the .ini file:

Expert=Free Robots\BlackCrows WhiteSoldiers RSI.ex5
ExpertParameters=
Symbol=EURUSD_MB
Period=H1
Deposit=10000
Leverage=1:100
Model=0
ExecutionMode=1
Optimization=0
OptimizationCriterion=0
FromDate=2024.07.16
ToDate=2024.08.07
ForwardMode=0
Report=Report BlackCrows WhiteSoldiers RSI.ex5
ReplaceReport=1
ShutdownTerminal=1


When I double-click on the start.bat file MT5 starts normally and performs backtest, saves the results as expected. 

but when I try to run it by shell cmd, the MT5 starts in the background (only noticeable on Task-manager) and at this stage I'm not exactly sure if it performs any backtest or not, and then shutdowns the terminal as we have said so in the ini file. otherwise it will be running at background without noticing. and the report file is not saved. 
again, when I double-click everything works fine.


my python code:

import subprocess

subprocess.call([r'C:\\Program Files\\MetaTrader 5\\start.bat'])

same results with then shell_exec() func.


so I thought it might be permission problem, but when I printed out 'whoami' I saw it's already Administrator .



I'd appreciate any helps. 

Best,