Client side script?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm working in ASP.NET 2.0 and am having problems with some client side
script on my .aspx pages.

The script looks like this:
<script language=vbscript>
function OpenFile(FileToOpen)
Set oShell = CreateObject("WScript.Shell")
oShell.Run("explorer " & FileToOpen)
end function
</script>

The idea was to use explorer to open these files. The problem I'm having
though is on the line:
Set oShell = CreateObject("WScript.Shell")
I keep getting the message ActiveX component can't create object:
'WScript.Shell'

I'm totally confused because this exact same code runs fine if I write it in
a .htm file.
Why does my browser treat my .aspx page differently than the .htm file?

Thanks,
 
I get the error that you mentioned only if I set all options under "ActiveX
controls and plug-ins" to "disable" in the Internet Options->Security->Custom
level, but if these options are set to "Enable", your script works fine.
 
Thanks Phillip,

I tested this like you state, and I believe you are correct. I see that
adding my site to trusted sites has the desired effect, and may be the
approach I will have to take.

Thanks again,

- Chase
 
Back
Top