
windows – JScript:如何运行外部命令并获得输出?
我正在使用cscript.exe运行我的JScript文件. 在脚本中,我需要调用外部控制台命令并获取输出. 尝试: var oShell = WScript.CreateObject(WScript.Shell);var oExec = oShell.Exec(cmd /c dir);WScript.Echo(Status +oExec.Status);WScript.Echo
我正在使用cscript.exe运行我的JScript文件. 在脚本中,我需要调用外部控制台命令并获取输出. 尝试: var oShell = WScript.CreateObject(WScript.Shell);var oExec = oShell.Exec(cmd /c dir);WScript.Echo(Status +oExec.Status);WScript.Echo