[Javascript] JScript and Windows Scripting Host

Tim Lewis twlewis at softhome.net
Tue May 29 14:46:41 CDT 2007


I have a line of code for a WSH shell:

var WshShell = WScript.CreateObject("WScript.Shell");

I get the error message. 'WScript is undefined'

I do not understand why.  What is more confusing to me is that I can run a
VBScript with the line:
Set objShell = CreateObject("Wscript.Shell")
and this runs ok.
If I understand WSH correctly, it is simply getting access to Windows
functions.(please correct me if I am wrong in my thinking)
It seems that if it failed in one language, it would fail in both.

Thank you,
Tim





More information about the Javascript mailing list