title: Pass variable from JavaScript to Windows batch file
body: <p>Is it possible to create a variable in JavaScript and pass it to a batch file?
  Just as a simple test echo a variable and move a file up a directory.</p>
  
  <p><strong>JavaScript.js</strong></p>
  
  <pre><code>var s = "Gwen Stefani";
  var myFile = "C:\\temp\\myfile.txt"
  myBat.execute();
  </code></pre>
  
  <p><strong>myBat.bat</strong></p>
  
  <pre><code>echo s 
  move myFile ..
  </code></pre>
  
  <p>An alternative is to create a string which is saved out as a batch file and then executed, but I was wondering if if it could be done directly.</p>