title: Create VBScript script detect iexplore
body: <p>I want to create a VBScript script to detect Internet Explorer opening page and opening new tab in the same window. For example, when I manually open Internet Explorer at www.google.com the VBScript will do:</p>
  
  <ul>
  <li>detect and open new tab in same window with www.example.com</li>
  <li>but do this only once</li>
  </ul>
  
  <p>I tried with this code:</p>
  
  <pre><code>Set wshShell = CreateObject("WScript.Shell")
  Do
      page1 = wshShell.AppActivate("Blank page - Internet Explorer")
      If page1 = True Then
          Set page2 = CreateObject("InternetExplorer.Application")
          page2.Navigate "http://www.example.com", CLng(navOpenInNewTab)
      End If
      WScript.Sleep 500
  Loop
  </code></pre>