title: Flex3 / Air 2: NativeProcess doesn't accepts standard input data (Error #2044 & #3218)
body: <p>I'm trying to open cmd.exe on a new process and pass some code to programatically eject a device; but when trying to do this all I get is:</p>
  
  <p>"Error #2044: Unhandled IOErrorEvent:. text=Error #3218: Error while writing data to NativeProcess.standardInput."</p>
  
  <p>Here's my code:</p>
  
  <pre><code>    private var NP:NativeProcess = new NativeProcess();
  
      private function EjectDevice():void
      {
               var RunDLL:File = new File("C:\\Windows\\System32\\cmd.exe");
               var NPI:NativeProcessStartupInfo = new NativeProcessStartupInfo();
               NPI.executable = RunDLL;
               NP.start(NPI);
               NP.addEventListener(Event.STANDARD_OUTPUT_CLOSE, CatchOutput, false, 0, true);
               NP.standardInput.writeUTFBytes("start C:\\Windows\\System32\\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll");
               NP.closeInput();
      }
  </code></pre>
  
  <p>I also tried with writeUTF instead of writeUTFBytes, but I still get the error. Does anyone have an idea of what I'm doing wrong?.</p>
  
  <p>Thanks for your time :)
  Edward.</p>