Click here to Skip to main content
15,888,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, this is Vikash Gohil.

I am posting this again as i have yet not got any solution to this problem.

I have a Javascript Code as below.

C#
function PCName()
             {
                  var oWshShell = new ActiveXObject("WScript.Shell");
                  var txtbox = document.getElementById("<%=txtPCName.ClientID%>");
                  txtbox.value=oWshShell.ExpandEnvironmentStrings("%ComputerName%");
                  var tbox = document.getElementById("<%=txtPCName.ClientID%>");
                  tbox.value=txtbox.value;
             }


Now the problem is uptil now the application was running under Windows XP SP2 OS and was working fine without any problem.

Currently client has upgraded the OS and installed Win XP SP3.

Now the same code gives error "Automation Server Can't Create Object".

Why This happens? Is there anything replated to XP SP3.

I have also lowered the browser Security Settings.

But no success.
Posted
Comments
Sandeep Mewara 20-Sep-10 12:15pm    
Sure you enabled correct settings and allowed running of ActiveX scripts?
cmanderson 20-Sep-10 14:25pm    
Yeah as Sandeep suggested could be ActiveX script setting issue. I've seen someone mention that they needed to to set "Initialize and script ActiveX control not marked as safe" to enable to get past this error. Enable those settings and see what happens.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900