[Javascript] JScript and Windows Scripting Host

Tim Lewis twlewis at softhome.net
Tue May 29 15:30:09 CDT 2007


Thanks Mike; it works excellent after I changed it to an ActiveX.

Tim


> On 5/29/07, Tim Lewis <twlewis at softhome.net> wrote:
>>
>> 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.
>>
>
> try:  var WshShell = new ActiveXObject("WScript.Shell");
>
> fyi - depending on how you have implemented your xmlhttp library, you
> might
> be able to use them in WSH too (which is a really cool way to let your WSH
> scripts talk to (reuse) your webservices)
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list