Yashar Safarzadeh:
I want to get cmd.exe response to get some machine id from it and using in my mql5 code
Why have you posted in the MQL4 section.
I will move your post to General.
Keith Watford:
Yes,I did mistake, move it please.
Why have you posted in the MQL4 section.
I will move your post to General.
Yashar Safarzadeh: But I couldn't find how to get the cmd response to following line in an string variable.
Direct the output to a file, read the file.
William Roeder:
But "ShellExecuteW " doesn't provide any output in text file. How can I output cmd results in an text file?
Direct the output to a file, read the file.
The command you call must redirect.
William Roeder:
The command you call must redirect.
I used following code to output the text file. But nothing was produced.
string strParameters = "wmic csproduct get uuid >> myoutput.txt"; int result = ShellExecuteW(0, "open", "cmd.exe", strParameters, NULL, 0); if (result <= 32) Print("Shell Execute Failed: ", result); Print(result);
While running following command produces the output file.
"wmic csproduct get uuid >> myoutput.txt"
Printing Error gets value 42.
You can not redirect from ShellW. Create a batch file that does.
Syntax for calling AutoIt compiled Script (.exe) using ShellExecuteW in MT4 EA (Quest) - MQL4 programming forum
run a *.bat from EA (Route206) - MQL4 programming forum
Execute an exe-file from MQL (Steffen Siegert) - MQL4 programming forum
Syntax for calling AutoIt compiled Script (.exe) using ShellExecuteW in MT4 EA (Quest) - MQL4 programming forum
run a *.bat from EA (Route206) - MQL4 programming forum
Execute an exe-file from MQL (Steffen Siegert) - MQL4 programming forum
William Roeder:
You can not redirect from ShellW. Create a batch file that does.
Syntax for calling AutoIt compiled Script (.exe) using ShellExecuteW in MT4 EA (Quest) - MQL4 programming forum
run a *.bat from EA (Route206) - MQL4 programming forum
Execute an exe-file from MQL (Steffen Siegert) - MQL4 programming forum
You can not redirect from ShellW. Create a batch file that does.
Syntax for calling AutoIt compiled Script (.exe) using ShellExecuteW in MT4 EA (Quest) - MQL4 programming forum
run a *.bat from EA (Route206) - MQL4 programming forum
Execute an exe-file from MQL (Steffen Siegert) - MQL4 programming forum
Dear William
Thanks for your guide. I solved the problem by running from a batch file and putting the files to Terminal Files folder.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear All
I want to get cmd.exe response to get some machine id from it and using in my mql5 code
But I couldn't find how to get the cmd response to following line in an string variable.
wmic csproduct get uuid
please help me.