title: Running multiple NodeJS projects at once with a batch file
body: <p>I have a file structure like this:</p>
  
  <pre><code>bots -|
        |- test1 -|
                  |- index.js
                  |- activate.bat
                  |- token.txt
  
        |- test2 -|
                  |- index.js
                  |- actiate.js
                  |- token.txt
  
        |- run_all.bat
  </code></pre>
  
  <p><code>index.js</code> are files to be run be NodeJS with the <code>node</code> command.  Both <code>index.js</code> files require a key that is stored in <code>token.txt</code> file.  The <code>index.js</code> file reads the text file</p>
  
  <p><code>activate.bat</code> is simply this:</p>
  
  <pre><code>@echo off
  node index.js
  </code></pre>
  
  <p>However I want to run both at once, and by only starting one <code>.bat</code> file, this is where <code>run_all.bat</code> comes in.</p>
  
  <p>I have tried to run each file like I ran in <code>activate.bat</code> so:</p>
  
  <pre><code>@echo off
  
  echo Starting all bots...
  
  start /b node test1\index.js
  start /b node test2\index.js
  </code></pre>
  
  <p>However I get an error:</p>
  
  <pre><code>PS C:\Users\Simon\Desktop\bot&gt; ./run_all.bat
  Starting all bots...
  PS C:\Users\Simon\Desktop\bot&gt; test1 running
  test2 running
  (node:10176) UnhandledPromiseRejectionWarning: Error: An invalid token was provided.
      at Promise (C:\Users\Simon\node_modules\discord.js\src\client\rest\RESTMethods.js:34:54)
      at new Promise (&lt;anonymous&gt;)
      at RESTMethods.login (C:\Users\Simon\node_modules\discord.js\src\client\rest\RESTMethods.js:33:12)
      at Client.login (C:\Users\Simon\node_modules\discord.js\src\client\Client.js:279:30)
      at ReadFileContext.callback (C:\Users\Simon\Desktop\bot\test1\index1.1.js:88:12)
      at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:235:13)
  (node:4836) UnhandledPromiseRejectionWarning: Error: An invalid token was provided.
      at Promise (C:\Users\Simon\node_modules\discord.js\src\client\rest\RESTMethods.js:34:54)
      at new Promise (&lt;anonymous&gt;)
      at RESTMethods.login (C:\Users\Simon\node_modules\discord.js\src\client\rest\RESTMethods.js:33:12)
      at Client.login (C:\Users\Simon\node_modules\discord.js\src\client\Client.js:279:30)
      at ReadFileContext.callback (C:\Users\Simon\Desktop\bot\test2\index.js:65:12)
      at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:235:13)
  (node:10176) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
  (node:4836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
  (node:10176) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  (node:4836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  </code></pre>
  
  <p>When run each <code>activate.bat</code> alone I <strong>do not</strong> get this error,  what is going wrong?  Are my batch commands somehow mixing up the different <code>token.txt</code> files</p>