In microsoft.public.scripting.jscript message <j284c71bqch2o30h52g4vbfg8
qbb3...@4ax.com>, Tue, 15 Nov 2011 18:22:03, Michael Bednarek
<
mbATmbed...@BLACKHOLESPAM.NET> posted:
It might. I did not know about WSF 2. I did, however, know about
mixing VBScript and JScript on Web pages for IE.
If a file that runs at a command prompt using the batch line
@cscript //nologo SEEK.JS %1 ... %9
can easily be changed to be a WSF 2 file that can be started from the
command line, and that mainly writes to the command prompt console, then
the answer is probably YES. .... BUT
P.S. I added WScript.echo(result) to the end of the JavaScript
taken from the page you cited, and it appeared pop-up, not to
DOS box. DOS box output is essential.
I'd much prefer the user to work only in the Command Prompt box.
But, looking at that page again, that's probably not possible.
If I remain with CScript and *.js, another question - can a *.js file
being run by WScript as GUI detect that WScript and abort, crash, or
convert to CScript? A CScript run is fast; an inadvertent WScript run
can require far too many clicks.
P.P.S. The aforesaid test, when run command-line using CScript, writes
to the DOS box where wanted; the condition of the P.S. is
satisfied.
If background is wanted, see
<
http://www.merlyn.demon.co.uk/programs/32-bit/00index.htm> (short),
looking for SEEK.BAT. However, I'm in the middle of another, not
necessarily easy, functional addition to the script, and then the code
needing the response will have to be written, so I will not immediately
WSF it.
Meanwhile, here's something showing what confused me for a while :
PARTIAL COMMAND-PROMPT SCREEN-COPY COMMENT
DOSprompt>type $1.js
WScript.echo(NaN, NaN.toString(), NaN) Simple enough
DOSprompt>cscript//nologo $1.js
1.#QNAN NaN 1.#QNAN Unexpected
Anyway, thanks for the answer, including the link; whether or not I can
use WSF 2 in this job, it's nice to know about.
--
(c) John Stockton, nr London, UK. ?@
merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <
http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.