title: Accessing JavaScript method from a batch file
body: <p>I have gone through multiple post like <a href="https://stackoverflow.com/questions/4999395/how-does-this-windows-batch-file-run-embedded-javascript">Embedded js in a batch file</a> which suggest the possibility of combining batch file and javascript. My question here is-whether it is possible to use the method of a .js file in .bat file? For example-Define a js file with some methods as below -</p>
  
  <h2>test.js</h2>
  
  <pre><code>add:function(a, b){ return a+b;}
  </code></pre>
  
  <h2>test.bat</h2>
  
  <pre><code>add(1, 2); ::Or something like add 1 2
  </code></pre>
  
  <h2>Output</h2>
  
  <pre><code>C:\&gt;test
  </code></pre>
  
  <p>3</p>