Im running my JScript file using cscript.exe. In the script I need to call an external console command and get the output. Tried: var oShell WScript.CreateObject("WScript.Shell") var oExec oShell.Exec(cmd /c dir) WScript.Echo("Status "oExec.Status) WScript.Echo("ProcessID Wscript.shell.run and Wscript.shell.exec do not display the same outputs. output file from WScript.shell.run -gt. and redirect standard output in the same.(WScript.Shell)WshShell.Run. path and a destination output file.
Is there an easy way to run this. Set objSh WScript.CreateObject("WScript.Shell").objSh.Run theCmd. The Sub below, RunHere, executes a command in the specified working directory and then changes back to the original directory.