I see what you mean after re-reading the thread. I initially didn't see the
case that the script was being ported from a remote / wsc / wsh routine (and
as such would be able to create and run apps).
Sometimes it's a little difficult to see the intention of the posted issue.
In this case, I saw the error, not the underlying root cause (moving script
across engines and platforms).
Thanks for your input Michael.
Chris Barber.
Quote:
> Just an FYI, this whole problem (repeated and "solved" on another thread
in another NG) all revolved
Quote:
> around not knowing how to debug WSH hosted scripts. The OP was "porting"
his WSH hosted scripts
Quote:
> into IE to debug them since he knew how to do *that* kind of script
debugging.
> Once he found out how to enable WSH 2.0 script debugging, it all became a
moot point ;-)...!!!
Quote:
> --
> Michael Harris
> Microsoft.MVP.Scripting
> --
> Please do not email questions - post them to the newsgroup instead.
> --
> > WScript IS undefined (nowhere in your code do you have a variable/object
> > named WScript) so JavaScript doesn't know what to do with it.
> > The WScript object is assigned to the variable 'WshShell'. Perhaps you
can
> > use WshShell.Echo ("Done"); (I don't know cos I haven't ever had to do
> > this).
> > Chris barber.
> > > I'm new to scripting and it seems that I didn't grasp something
> > elementary.
> > > The following sample code :
> > > <script language="JScript">
> > > var WshShell = new ActiveXObject ("WScript.Shell");
> > > var FileSysObject = new ActiveXObject
> > > ("Scripting.FileSystemObject");
> > > WshShell.Run("D:\\my_prog.exe");
> > > WScript.Echo("Done");
> > > </script>
> > > returns the error "WScript is undefined" although as a script (*.wsh)
it
> > > causes no
> > > problem (using WScript.CreateObject instead of new ActiveXObject. Why
do I
> > > have to change this at all ? )
> > > I'm using Jscript 5.5 + WSH 2.0 + MS Script De{*filter*} 1.0a.
> > > I'll appreciate any help. Thanks.