D
Dr John Stockton
The following DOS prompt command line, in a Win98 DOS box,
cscript //nologo ~tmp.js
executes file ~tmp.js as javascript/Jscript.
The following batch file, similarly run, executes the same.
@echo off
echo WScript.Echo(new Date().toUTCString()); > ~tmp.js
cscript //nologo ~tmp.js | STOW GMT
del ~tmp.js
( STOW is a program of mine; the (first line of the) standard output of
cscript is stored in environment variable GMT, in DOS..Win98/ME but
not NT-type systems. )
Such scripts are presumably on-topic here. They will differ from Web-
type scripts in the matter of I/O and controls. They add features to
batch file use, because javascript can do much more than pure Batch; it
can, for example, get GMT.
(a) ISTM worth mentioning this in the FAQ, as it opens a door that might
not previously have been noticed and which has much on the other side.
(b) What is there to say about differences of DOM-type? Differences in
I/O? Use of wscript?
(c) Are any good references known, dealing with the above and not too
much else?
cscript //nologo ~tmp.js
executes file ~tmp.js as javascript/Jscript.
The following batch file, similarly run, executes the same.
@echo off
echo WScript.Echo(new Date().toUTCString()); > ~tmp.js
cscript //nologo ~tmp.js | STOW GMT
del ~tmp.js
( STOW is a program of mine; the (first line of the) standard output of
cscript is stored in environment variable GMT, in DOS..Win98/ME but
not NT-type systems. )
Such scripts are presumably on-topic here. They will differ from Web-
type scripts in the matter of I/O and controls. They add features to
batch file use, because javascript can do much more than pure Batch; it
can, for example, get GMT.
(a) ISTM worth mentioning this in the FAQ, as it opens a door that might
not previously have been noticed and which has much on the other side.
(b) What is there to say about differences of DOM-type? Differences in
I/O? Use of wscript?
(c) Are any good references known, dealing with the above and not too
much else?