Command line 在JScript中需要从shell解析脚本输出

Command line 在JScript中需要从shell解析脚本输出,command-line,activexobject,jscript,Command Line,Activexobject,Jscript,我想执行一个命令并解析shell的输出。我在TestComplete中使用JScript。我已经发现我可以使用WScript.shell运行命令。但我不知道如何解析JScript中的输出。有什么提示吗 var shell = new ActiveXObject("WScript.shell"); if (shell) { shell.run("myCommandIWantToParseOutputfrom.sh"); } 查看该方法,而不是Run var wsh=newActiveXObj

我想执行一个命令并解析shell的输出。我在TestComplete中使用JScript。我已经发现我可以使用WScript.shell运行命令。但我不知道如何解析JScript中的输出。有什么提示吗

var shell = new ActiveXObject("WScript.shell");
if (shell)
{
  shell.run("myCommandIWantToParseOutputfrom.sh");
}
查看该方法,而不是
Run

var wsh=newActiveXObject(“WScript.Shell”);
var cmd=wsh.Exec(“cmd/c dir c:\/on”);
while(cmd.Status==0){
WScript.Sleep(100);
}
var output=cmd.StdOut.ReadAll();
Echo(输出);