John Stockton
2022-11-11 23:35:57 UTC
I have a batch file containing this line :-
CScript //nologo THING.JS
That *.JS file finishes with :-
WScript.echo(S)
so that I can read the answer S in a small window.
How, most straightforwardly, can I get the value of S (an alphanumeric string of 10 characters) back to the batch file, for example as a local environment variable accessible as %FRED% ??
I have thought of using something like (untested)
CScript.echo("set FRED=" + S),
redirecting that output to a file ALEC.BAT, and executing that; but there should be a better way.
Speed is of no importance; it will typically be executed once a day at login time. I do NOT want to rewrite THING.JS in pure Batch code.
CScript //nologo THING.JS
That *.JS file finishes with :-
WScript.echo(S)
so that I can read the answer S in a small window.
How, most straightforwardly, can I get the value of S (an alphanumeric string of 10 characters) back to the batch file, for example as a local environment variable accessible as %FRED% ??
I have thought of using something like (untested)
CScript.echo("set FRED=" + S),
redirecting that output to a file ALEC.BAT, and executing that; but there should be a better way.
Speed is of no importance; it will typically be executed once a day at login time. I do NOT want to rewrite THING.JS in pure Batch code.
--
(c) John Stockton, near London, UK. Using Google Groups. |
(c) John Stockton, near London, UK. Using Google Groups. |