title: Error passing multiple commands to Cisco CLI via plink
body: <p>I've gotten some help with an earlier part of this batch file, but now I'm having trouble with the final component. 
  I've tried a few things with no success. I tried changing the CRLF to LF which did nothing. I also tried rephrasing the commands a few ways but I am still not getting anywhere. The following is my main batch file.</p>
  
  <pre><code>@echo on
  
  REM delete deauth command file
  SET OutFile="C:\temp\Out2.txt"
  IF EXIST "%OutFile%" DEL "%OutFile%"
  
  plink -v -ssh *@x.x.x.x -pw PW -m "c:\temp\WirelessDump.txt" &gt; "C:\temp\output.txt"
  
  setlocal
  for /f %%a in (C:\temp\output.txt) do &gt;&gt; "Out2.txt" echo wir cli mac-address %%a deauth forced
  
  REM Use commands in out2 to deauth
  plink -v -ssh *@x.x.x.x -pw PW -m "c:\temp\Out2.txt"
  pause
  </code></pre>
  
  <p>Below this sentence is the command found in <code>Out2</code> which I think is giving the actual trouble. The number of lines varies but they are all this particular command just with differing MACs.</p>
  
  <pre><code>wir cli mac-address xxxx.xxxx.xxxx deauth forced
  </code></pre>
  
  <p>If <code>Out2</code> has only a single line it runs fine, no issues. But when there are multiple lines, it fails with an error stating that the Line has an invalid autocommand. It's almost as if it was reading it as one contiguous command. As I mentioned above I changed from CRLF to LF hoping IOS would like it better, but that failed. I've tried adding extra lines between the commands, and I've tried calling the login every time from that file. </p>
  
  <p>I am hoping that there is a way to tailor the commands to pass all lines one at a time to keep this down to a minimum of files. </p>
  
  <p>I had another thought but it is kinda/very clunky. If there was a way to output each of those MAC deauth commands to their own file in a saperate folder (out1, out2, out3), and have the BAT able to run all the randomly generated files in that folder so that each one is a separated plink session. </p>
  
  <p>Let me know if I need to change/add/elaborate on anything. Thanks in advance for anything you guys are willing to help with. I appreciate it. </p>
  
  <p><strong>EDIT:</strong> Martin has pointed out what the limitation actually is. It appears to be a limitation on Cisco to accept blocks of commands through SSH. So I still have the same question really, I just need some help figuring a workaround to this issue. I'm thinking the multiple file solution I mentioned above may have some possibility. But I'm too much of a noob to know how to make that work. I'll update if I have any breakthroughs though. Thanks for any contributions!</p>