title: How to send multiple statements to the same .cmd instance?
body: <p>How can I send multiple commands to the same instance of a .cmd script? Doing so from either cmd <em>or</em> powershell is acceptable. </p>
  
  <p>I'm not trying to to send multiple commands in a single concatenated statement-- character-limits could be a factor with very large scripts. Rather, I want to send multiple commands, as separate statements, to a running .cmd script. When I say ".cmd", I do <em>not</em> mean "cmd.exe"-- I mean a custom shell script, saved to disk with a <code>.cmd</code> extension. </p>
  
  <p>Specifically, <a href="https://stackoverflow.com/a/31279372">this post</a> shows how to create a powershell4.cmd script which launches a .Net 4.0 PowerShell. I want to send a sequence of commands to that powershell. </p>
  
  <p>For example, is it possible to get a handle to that new shell, in order to send additional commands to it?</p>