Friday, February 15, 2008

JScript: collecting the output after run command

var shell = WScript.CreateObject("WScript.Shell");

var exec = shell.Exec("ipconfig /all");

WScript.StdOut.Write(exec.StdOut.ReadAll());

From http://snippets.dzone.com/posts/show/627