VBScript - Find IE window

I was wondering if anyone knew how to find if a certain IE window is open (by it's window title) using VBScript.

I'm looking for the VBScript equivalent of this this VB.net code:

Dim IE() as Process
Dim n as Integer
Dim bOpen As Boolean = False
IE = Process.GetProcessesByName("IEXPLORE")
If IE.Length > 0 Then
    For n = 0 to IE.Length - 1
        If IE(n).MainWindowTitle.StartsWith("Website A") Then
            MsgBox("Website A is open")
            Exit For
        End If
    Next
End If

THANKS!!!
CaitlinRobertsAsked:
Who is Participating?
 
AzraSoundCommented:
Dim shWin
Dim i

Set shWin = CreateObject("Shell.Application")
For i = 0 To shWin.windows.count - 1
    If Left(shWin.windows(i).LocationName, 9) = "Website A" Then
        MsgBox "Website A is open"
        Exit For
    End If
Next
0
 
CaitlinRobertsAuthor Commented:
Perfect!  Thanks AzraSound!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.