ASP.NET - Microsoft JScript runtime error: 'WScript' is undefined

Asked By hvm on 20-Jul-11 04:53 AM
function init() {
        if (!Skype.Client.IsRunning)
          Skype.Client.Start();        
        Skype.Attach(false);
        WScript.ConnectObject(oSkype, "Skype_");       
        
      } 

it gives error like "Microsoft JScript runtime error: 'WScript' is undefined"
Anoop S replied to hvm on 20-Jul-11 07:13 AM
The WScript.Object is provided by the w/cscript.exe script host. If you execute JScript in other contexts (browser, server, ... ), you'll have to try the language's function (GetObject, CreateObject, new ActiveXObject) or the equivalent function of that host.
Anoop S replied to hvm on 20-Jul-11 07:16 AM
You have install the Windows Scripting Host.

http://www.microsoft.com/downloads/details.aspx?FamilyID=c717d943-7e4b-4622-86eb-95a22b832caa

I thought it is bundled with Windows, but maybe it isn't installed on your computer.
Reena Jain replied to hvm on 20-Jul-11 10:01 AM
Hi,

The WScript object is the WSH application object. It is exposed automatically when a script runs—you don't have to create a reference to it. The object exposes several methods and properties. All you need is the object name WScript followed by a dot and then the property name.

Hope this will help you

hvm replied to Reena Jain on 22-Jul-11 07:32 AM
Hi Reena,

thanks for reply but it not working  so i try to create object of WScript

var wshShell = new ActiveXObject("WScript.Shell");


so its giving me below error


"Microsoft JScript runtime error: Automation server can't create object"

 please help me to solve this...

Thanks,
HVM