title: executing a batch or script of commands using Putty
body: <p>Currently I dial in to a site with putty and copy all 100 commands using notepad++ and paste them into putty using right click and they all give me the expected results. </p>
  
  <p>I don't want to have to copy and paste each time I connect.
  I am trying to use putty to load a saved session and then execute a series of commands.
  can this be done with a serial connection ??
  this is as far as I can get
  my batch file looks like this</p>
  
  <p>plink -load session1 &lt; commands.cmd > output.txt </p>
  
  <p>for testing my commands.cmd looks like this</p>
  
  <p>ATDT5551212</p>
  
  <p>functionally this is fine for dialing and executing a single line as my output.txt file looks like this</p>
  
  <p>ATDT5551212
  CONNECT 1200</p>
  
  <p>so I know I can grab a command from a file and send the output of the session to another file... </p>
  
  <p>if I add another command after the ATDT line then it fails to work properly however my output file shows it sent all the commands</p>
  
  <p>The problem is after dialing and connecting I want to be able to send another set of about 100 commands to get programming data out of a serial device and record it to text.
  How can I set this up as a batch to wait for the CONNECT 1200 and then execute another 100 different commands</p>
  
  <p>I tried as Martin suggested to change the EOL
   I added STXcommandETX and also separately tried an EOT and ESC and nothing changes its just dumping the entire command file and only executing the first line. the modem gets bombarded with all the other lines or commands,  it is attempting to execute the first line and then subsequently trying to give a response meanwhile plink just took the entire commands.cmd and dumps it at the modem and the modem is not expecting the dump.
  My guess is that plink can open and send my commands but cant interact with the Serial putty window once it is open.
  I am trying another program called ScriptCommunicator but am still testing plink/putty</p>