title: How to call MongoDB commands using .bat file
body: <p>I'm trying to execute MongoDB command <em>(for create DB)</em> using .bat file.</p>
  
  <p>For that I've tried:</p>
  
  <pre><code>cd C:\Program Files\MongoDB\Server\3.4\bin
  mongo 
  mongo --eval "use MyDatabase"
  pause
  </code></pre>
  
  <p>But it gives an error <code>missing ; before statement @(shell eval):1:4</code> <br>
  How can I solve this issue?</p>
  
  <p>Side: I've already gone through <a href="https://stackoverflow.com/questions/38772594/mongodb-syntaxerror-missing-before-statement-shell">MongoDB SyntaxError: missing ; before statement @(shell)</a></p>