473,320 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Client side script?

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,
Jan 26 '06 #1
2 1195
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.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Chase" wrote:
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,

Jan 26 '06 #2
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

"Phillip Williams" wrote:
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.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Chase" wrote:
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,

Jan 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side...
5
by: tmb | last post by:
Is there a way to use ASP to 'push' a new image to the client every 15 seconds or so? I guess the entire page will have to be 're-sent' to the client but I'm not sure. I'm trying to 'rotate'...
8
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
1
by: Carl Jones via .NET 247 | last post by:
(Type your message here) I'm trying to run a client-side script from a web page. It's a VB script that gets information (computer name, software versions etc )about the computer and writes it to a...
9
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What...
7
by: Mike Rand | last post by:
I am having a really hard time trying to get some client side code hooked up in VS2005, ASP 2.0. The code is in an .inc file (vbscript). The first problem I am encountering is the ASP.NET page...
3
by: jesper_lofgren | last post by:
Hello, I have a problem, i have a event in asp.net codebehind file that updating a datasource. If that update went well i want to refresh my treeview thats on another page. The script works...
1
by: Chris | last post by:
Hi, I have jsut started to learn ASP development and have read many articles regarding which is the best to use regarding JavaScript or VBScript. All of the learning that I have done so far has...
5
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called...
5
by: Simon | last post by:
I heard that we could do that by using AJAX. Could anybody share how to do it? Thanks.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.