title: can't communicate with spawn process in node.js
body: <p>hi i'm working on an electron app
  form the app i wise to control several external command line applications, for example plink,
  i i'm using windows
  i trying to use spwan to great a cmd process :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const p = spawn('cmd', ['\\c'] ) // c or K both yield the same result
  
  p.stdin.setEncoding('utf-8')
  
  p.stdout.on('data', (data) =&gt; {
      console.log(`stdout: ${data}`);
  })
  
  p.stderr.on('data', (data) =&gt; {
      console.error(`stderr: ${data}`);
  })
  
  p.on('close', (code) =&gt; {
      console.log(`child process exited with code ${code}`);
  })</code></pre>
  </div>
  </div>
  </p>
  <p>after ruining, i'm getting the fallowing output</p>
  <blockquote>
  <p>stdout: Microsoft Windows [Version 6.1.7601]
  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.</p>
  </blockquote>
  <blockquote>
  <p>C:\Program Files (x86)\electron&gt;</p>
  </blockquote>
  <p>after that i'm running a simple command</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>p.stdin.write('hostname\n')</code></pre>
  </div>
  </div>
  </p>
  <p>but no response is typed back into the console...</p>