title: use powershell to load new IE windows and do things in background
body: <p>I am using the following home-made script to extract data from an in-house database with an web-interface restricted to IE only.</p>
  
  <pre><code>function script([string]$cluster, [string]$fromdate, [string]$todate)
  {
  $ie = new-object -com "InternetExplorer.Application"
  $ie.navigate("http://testing.home")
  Start-Sleep -s 5
  $ie.visible=$true
  $doc=$ie.document
  $login1 = $doc.getElementByID("TxtUser")
  $login2 = $doc.getElementByID("TxtPassword")
  $loginbtn = $doc.getElementByID("BtnLogin")
  $login1.value= "username"
  $login2.value= "password"
  $loginbtn.click()
  Start-Sleep -s 5
  $ie.navigate("http://testing.home/download.aspx")
  Start-Sleep -s 5
  $dl1 = $doc.getElementById("ddlloc")
  $dl2 = $doc.getElementById("txtFromDate")
  $dl3 = $doc.getElementById("txtToDate")
  $dl1.value=$cluster
  $dl2.value=$fromdate
  $dl3.value=$todate
  $dlbtn = $doc.getElementByID("btnSearch")
  $dlbtn.click()
  
  Start-Sleep -s 5
  }
  </code></pre>
  
  <p>It works OK for me, but I wonder if the script can be modified so that everything is done in background, without interrupting my work in my active window.</p>
  
  <p>I am using Win7. I wonder if there is any simple way for fixing it. Thanks.</p>