command line - Capture output of cmd query from Wscript.Shell run method -
i using following code to execute merge action . command initiates child process (manual merge tool) . using code child process not opened. error , output streams
wshshell = new activexobject("wscript.shell"); var launch="tf merge $/alpha/dev $/alpha/main /recursive /version:c4264~c4264"; var cmdrun = wshshell.exec(launch);
but when use following code, child process initiated . window closes operation finishes. not able output or error streams.
wshshell = new activexobject("wscript.shell"); var launch="tf merge $/alpha/dev $/alpha/main /recursive /version:c4264~c4264"; var cmdrun = wshshell.run(launch,1,1);
how can output of command line query while still using run() method ?????
var wshshell = new activexobject("wscript.shell"); var wshexec = wshshell.exec("nslookup"); var instream = wshexec.stdin; instream.writeline("help"); instream.writeline("exit"); var outstream = wshexec.stdout; var str = ""; while (!outstream.atendofstream) { str = str + outstream.readall(); } wscript.echo(str);
Comments
Post a Comment