Client side script?

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,
 
G

Guest

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top