title: How do I fix a "SCRIPT424: Object required: 'Environment'" in Internet explorer
body: <p>I'm trying to launch an IIS webapp in a new browser session, I'd prefer cross platform, but IE only is ok; I asked on the <a href="https://social.msdn.microsoft.com/Forums/ie/en-US/f1e6bc97-22ae-4731-a509-8e646625826a/internet-explorer-get-new-sessions-programatically?forum=iewebdevelopment" rel="nofollow noreferrer">MSDN</a> and they recommended code similar to the following, but it fails to find the Environment variable and MSFT has not gotten back to me in 2 days.</p>
  
  <p>Do I need to import something? Is there a good vbscript tutorial?</p>
  
  <pre><code>&lt;script type="text/vbscript"&gt;
          function VBLaunch(ByVal url)
              ProductDir= Environment.value("ProductDir")
              IF (Instr(1,ProductDir,"(x86)"))&gt;0 then
                  SystemUtil.Run "C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE", "-noframemerging " &amp;  URL'  Launch Internet explorer and enter given URL
              Else
                  SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","-noframemerging " &amp; URL'  Launch Internet explorer and enter given URL
              End if
          end function
  &lt;/script&gt;
  </code></pre>
  
  <p>This may be an instance of the XY problem, so if there is a better way short of rewriting most of the app to launch an IIS webapp so it gets a different Session cookie as the current tab I would be fine with it.</p>