title: Running Protractor through a batch file
body: <p>As the title suggests, I'm looking for a way to run Protractor tests through a batch which I would then set up a task scheduler around.  I found another question on here similar to my needs but it was a dead end real quick.</p>
  
  <p>Here's the ideal situation:</p>
  
  <ol>
  <li><p>Scheduled Task launches a batch file that runs the webdriver server</p>
  
  <ul>
  <li>Problem: Once the command prompt opens and executes the start command, how do I then open a second window to launch to protractor command?</li>
  </ul></li>
  <li><p>That Batch file either A) Calls to execute another batch file for the protractor config as the problem above describes.  Or B) Opens another command prompt that executes the protractor command.</p></li>
  <li><p>Once Tests are finishes both command prompts close.</p></li>
  </ol>
  
  <p>I have the super very basic 3 line batch to open the web server but am stuck on what to do next to actually kick off the tests without disrupting the webserver.</p>
  
  <p>EDIT: Code Attempts</p>
  
  <p>File1 contained</p>
  
  <pre><code>cd "C:\Protractor\"
  call "C:\bat2.bat"
  webdriver-manager start
  </code></pre>
  
  <p>File2 contained</p>
  
  <pre><code>START cmd /k
  cd "C:\Protractor\"
  protractor test.config.js
  </code></pre>
  
  <p>This Route opened 2 Command prompts as intended, but when the call to bat2, it would just perform the bat2 functions within the first command prompt and nothing happens in the second window.  Once the jasmine specs timeout in command prompt 1, the webdriver kicks off.  Which is understood based off the flow of the lines.  </p>
  
  <p>I've also tried combining the commands into one file but get the same results.  I've tried using only one command prompt but once the webdriver starts the server, new commands can't be entered.  </p>
  
  <p>I guess more simply, how do I change focus between command prompts and send respective commands to each?</p>
  
  <p>There's a step 4 which is out of scope but if it's easy to answer then by all means that would be amazing:  After the tests execute an HTML file of reports is generated locally.  I would like to automate the process of emailing those files to a particular mail group.  Is that achievable through batch commands as well?</p>
  
  <p>Thanks in advance for any help.</p>