Reputation: 17849
I want to get the output of the CMD prompt in windows using ActiveX control.
When i use the following code:
var w = new ActiveXObject("WScript.Shell");
var ex =w.Exec('cmd /c dir /b');
var ret = ex.StdOut.ReadAll();
alert(ret);
The command cmd /c dir /b works fine and I get a list of files in the alert message.
But when I use a command like cmd /c java -version I get an empty message. I tried many variations of the above command but none seems to work.
Anyone with a clue?
Upvotes: 0
Views: 1197