Writing the output of foo(x) to console: (must run under CSCRIPT ) WScript. ... How to write to text file with jscript in Windows Script Host?
stackoverflow.com