Shoutbox

Calling executable? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Calling executable? (/showthread.php?tid=77860)

Calling executable? by juhl on 09-29-2007 at 03:57 PM

Hi,

Is it possible to make calls directly to an executable and read the output coming from stdout?

- Juhl


RE: Calling executable? by Hanumanji on 09-30-2007 at 09:15 AM

I don't know... but you can try this:


code:
var Executable = "Dir C:\\*.*";
var OutputFile = "C:\\Dump.txt";

new ActiveXObject("Wscript.Shell").Run("Cmd /c "+ Executable+" > " + OutputFile);

var Output = new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(OutputFile).ReadAll();
Debug.Trace( Output ) ;
new ActiveXObject("Scripting.FileSystemObject").DeleteFile(OutputFile);


I did not tested it... But.. it should work...