title: Setting an environment variable in javascript
body: <p>How can I set an environment variable in WSH jscript file that calls another program? Here's the reduced test case:</p>
  
  <pre><code>envtest.js
  ----------
  var oShell = WScript.CreateObject("WScript.Shell");
  var oSysEnv = oShell.Environment("SYSTEM");
  oSysEnv("TEST_ENV_VAR") = "TEST_VALUE";
  oExec = oShell.Run("envtest.bat", 1, true);    
  
  envtest.bat
  -----------
  set
  pause
  </code></pre>
  
  <p>I expect to see TEST_ ENV _VAR in the list of variables, but it's not there. What's wrong?</p>
  
  <p>edit:</p>
  
  <p>If someone can produce a working code sample, I'll mark that as the correct answer. :)</p>