tags:

views:

348

answers:

1

I need to create a VBScript (WSH) to automatically open Internet Explorer and navigate a security web page. However, it always pops up a security alert before displaying that website. Can anyone provide a solution for either disables the pop up function (security certification) in IE or accepts the pop-up by the script?

Here is my script:

Dim objIE 
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "https://10.10.10.101:9000/Portal"

????

Set objIE = Nothing

Thanks a lot.

A: 

Way back in 2004, i had made these two functions to enable or disable IE security warning not sure whether applicable still but I would like to share.

Basically, I modified certain registry values to enable and disable the IE security warning.

Sub EnableActiveXWarning ()
Dim SHL
Dim sReg

Set SHL = CreateObject ("WScript.Shell")

sReg = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1201"

If SHL.RegRead (sReg) = 1 Then
    MsgBox "ActiveX Warning is already enabled!",vbExclamation
Else
    SHL.RegWrite sReg,1,"REG_DWORD"

    If SHL.RegRead (sReg) = 1 Then
        MsgBox "The ActiveX Warning was successfully enabled.",vbInformation
    Else
        MsgBox "An unknown error has occured !!",vbCritical
    End If
End If
Set SHL = Nothing
End Sub


Sub DisableActiveXWarning ()
Dim SHL
Dim sReg

Set SHL = CreateObject ("WScript.Shell")

sReg = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1201"

If SHL.RegRead (sReg) = 0 Then
    MsgBox "ActiveX Warning is already disabled!",vbExclamation
Else
    SHL.RegWrite sReg,0,"REG_DWORD"

    If SHL.RegRead (sReg) = 0 Then
        MsgBox "The ActiveX Warning was successfully disabled.",vbInformation
    Else
        MsgBox "An unknown error has occured !!",vbCritical
    End If
End If
Set SHL = Nothing
End Sub
Sarfraz
Thank you very much for the quick response. Unfortunately, the Security Alert we have is related with a security certificate. It does not really work after I have applied your DisableActiveXWarning function. I guess your script only focuses on the AxtiveX warning.By the way, my computer is using IE V6 with Window XP.
Here is the details of Security Alert:Information you exchange with this site cannot be viewed or changed by others. However, there is a problem with the site's security certificate.The security certification was issued by a company you have not chosen to trust. View the certificate to determine whether you want to trust the certifying authority.The security certificate date is valid.The name on the security certificate is invalid or does not match the name of the site.Do you want to proceed?Yes No
@eightants: as i said i was not sure but that function worked at that time, let's hope you find a solution to this :)
Sarfraz
Thanks Sarfraz... I am going to find the key name for Security Certification in Windows registry.