From: rami4tis on
Hi
i try to run tis code on asp file :

Dim objApp
Dim objWindows, objWindow
Dim objIE

Set objApp = CreateObject("shell.application")
Set objWindows = objApp.Windows()
For i=0 to objWindows.Count - 1
Set objIEWnd = objWindows.Item(i)
If objIEWnd.LocationURL = "http://www.url.com Then
Set objIE = objIEWnd
objIE.Navigate(otherurl)
End If
Next

Set objIE = Nothing
Set objWindow = Nothing
set objWindows = Nothing
Set objApp = Nothing

ive got tis error :

"Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object "

the os is windows server 2003 ,

what is wrong ?
what can i do ?
any ideas ?

thanks in advance ,
poli
From: Tom Lavedas on
On Sep 22, 3:16 pm, rami4tis <rami4...(a)discussions.microsoft.com>
wrote:
> Hi
> i try to run tis code on asp file :
>
> Dim objApp
> Dim objWindows, objWindow
> Dim objIE
>
> Set objApp = CreateObject("shell.application")
> Set objWindows = objApp.Windows()
> For i=0 to objWindows.Count - 1
> Set objIEWnd = objWindows.Item(i)
>   If objIEWnd.LocationURL = "http://www.url.comThen
> Set objIE = objIEWnd
> objIE.Navigate(otherurl)
>   End If
> Next
>
> Set objIE = Nothing
> Set objWindow = Nothing
> set objWindows = Nothing
> Set objApp = Nothing
>
> ive got tis error :
>
>  "Microsoft VBScript runtime error '800a01ad'
> ActiveX component can't create object  "
>
> the os is windows server 2003 ,
>
> what is wrong ?
> what can i do ?
> any ideas ?  
>
> thanks in advance ,
> poli

BIG security problem. The Shell.Application is not marked safe for
client side scripting (because it's not). If this is intended for the
server side, it must be instantiated with the Server host, as in ...

Set objApp = Server.CreateObject("shell.application")

However, this approach cannot be used to access anything on the user's
machine, so I doubt it will be of any use to you - unless you want to
know how many IE browser windows are open on the server.

It appears you are trying to figure out if the user has a particular
website open. That should be impossible, if MS has done their job,
because that's none of your business (as a web site author).
_____________________
Tom Lavedas