I found a work around this...I'm using "open" instead of "exec", that allowes to run hidden command prompt window.
then I created a myprogram.bat file where I set command line to execute my program and redirect output into a file:
code:
C:\myprogram.exe > C:\output.txt
and finaly I read the output file in the script.
Somebody might find this is useful, here is the script code:
code:
var outputfile = "C:\\output.txt";
var fso = new ActiveXObject("Scripting.FileSystemObject");
var Shell = new ActiveXObject('WScript.Shell');
var oExec = Shell.Run("C:\\myprogram.bat", 0, true);
var output = "";
if(fso.FileExists(outputfile))
output = fso.OpenTextFile(outputfile, 1, true, 0).fH.ReadAll();