var WshShell = WScript.CreateObject("WScript.Shell"); var WshExec = WshShell.Exec("cmd /c dir c:\\"); while (!WshExec.StdOut.AtEndOfStream) WScript.Echo( WshExec.StdOut.ReadLine() ); WScript.Echo(WScript.Fullname + ", v:" + WScript.BuildVersion); WScript.Echo("Hi one"); WScript.Quit(); WScript.Echo("Hi two");