D
drk.kumar
I have an implementation issue with WMI scripts to check the user
machine processor. The implementation is working fine in the local
machine (Windows XP operating system). It is throwing script error in
the DEV environment (Application deployed in the linux box).
Following is the javascript code to detect the processor,
function detectProcessor()
{
var locator = new ActiveXObject
("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
When the application is deployed in the linux environment, and the
application invokes the detectProcessor() method, the browser throws an
error message as "Error : Automation server can't create object". (It
fails at the time of ActiveX creation) The above implementation is not
able to create the activeX component in the client machine.
I tried an alternate way as follows:
<object id='locator'
classid='clsid:76A64158-CB41-11D1-8B02-00600806D9B6'>
</object>
The above class id is for the built-in activeX
("WbemScripting.SWbemLocator") in the client windows OS Machine
function detectProcessor(){
var service = locator.ConnectServer();
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
This time the browser throws an exception that "the object doesn't have
the method or support the functionality". This time, the activeX
reference is pointed by the system. It failed to create the service. I
copied the view source code of the browser and saved into a
TestWin.html file. When I opened the html file in the local system, the
function executed without any problems.
Please reply if you know any resolution on this.
Thanks in advance
Krishnakumar
machine processor. The implementation is working fine in the local
machine (Windows XP operating system). It is throwing script error in
the DEV environment (Application deployed in the linux box).
Following is the javascript code to detect the processor,
function detectProcessor()
{
var locator = new ActiveXObject
("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
When the application is deployed in the linux environment, and the
application invokes the detectProcessor() method, the browser throws an
error message as "Error : Automation server can't create object". (It
fails at the time of ActiveX creation) The above implementation is not
able to create the activeX component in the client machine.
I tried an alternate way as follows:
<object id='locator'
classid='clsid:76A64158-CB41-11D1-8B02-00600806D9B6'>
</object>
The above class id is for the built-in activeX
("WbemScripting.SWbemLocator") in the client windows OS Machine
function detectProcessor(){
var service = locator.ConnectServer();
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
This time the browser throws an exception that "the object doesn't have
the method or support the functionality". This time, the activeX
reference is pointed by the system. It failed to create the service. I
copied the view source code of the browser and saved into a
TestWin.html file. When I opened the html file in the local system, the
function executed without any problems.
Please reply if you know any resolution on this.
Thanks in advance
Krishnakumar