title: Batch-File: Receive Data from the Serial-Port and write it into txt-File
body: <p>I'm trying to extract some data from an Arduino over the usb-serial-port and to write it into a txt-file. Therefore i'm using a batch-file (Windows 7, ordinary cmd), which sends e.g. a "d" to request the desired data from the Arduino. Having received the "d", the Arduino starts to send the data to the pc. The batch-file reads the data and writes it to some txt-file. The batch code is:</p>
  
  <pre><code>    mode COM4 BAUD=9600 PARITY=n DATA=8
      echo d &gt;COM4
      COPY COM4 data.txt
  </code></pre>
  
  <p>That works so far, but the problem is: </p>
  
  <p>How do I stop the COPY-process? </p>
  
  <p>When the Arduino is done with sending the data, the batch file keeps on wating for more. My preferred solution would be, that the Arduino sends some string like "end", the batch file recognizes this and stops reading. Is that somehow possible?</p>