[thelist] windows scripting host throws exception

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Thu Mar 24 06:05:31 CST 2005


Hi List!

A windows scripting host problem:

I am running client-side javascript on IE with proper ActiveX security
settings (from internet options of IE all of them are set to "prompt",
none of them is disabled)

the following script works:

<script>
var ExcelSheet;
ExcelApp = new ActiveXObject("Excel.Application");
</script>

however this one 

<script>
var shell = new ActiveXObject("WScript.Shell");
</script>

throws an "Automation Server can't create object" error.

When I change the extension of the file from ".html" to ".hta" and
choose to run it, it works again without giving an error.

here is an example hta 

test.hta:
<BODY ONLOAD='var Shell = new ActiveXObject("WScript.Shell");
   Shell.Run("regedit");'>

it runs without any complaints and opens the registry editor.

In short, given that my activex settings for the internet zone is
correct, why does

<script>
var shell = new ActiveXObject("WScript.Shell");
</script>

throw a "Automation Server can't create object" error?

I've googled around but was unable to find any similar situation. The
only thing people say is "adjust your activex security setting from
advanced security options", which I've triple checked that its okay.

I'd really appreciate your help.

TIA
Volkan.


More information about the thelist mailing list