title: PLink - Running a Script with output
body: <p>Working on automating several scripts that I run regularly. I've got what seemed like it should be an easy one, but I'm having difficulty with it. I'm using VBA to create two files and run this. One text file contains the list of commands and one BAT file containing the plink command initiating it all. Both files are below. The plink.exe and both these files are on the desktop after creation. </p>
  
  <p>The problem is that the script I'm running has output, even when I use the '&amp;' modifier at the end of the command. I'm not allowed to modify the script in any way. When the command file is run, the script runs just fine, but because of the output, the exit command is ignored. I've tried tacking on a sleep command to the end of the script line before the exit and tacking the exit on directly after the script line.</p>
  
  <p>BAT File - Chg.bat</p>
  
  <pre><code>plink [user]@[ip] -pw [password] &lt; C:\Users\Mike\Desktop\pcmd.txt
  </code></pre>
  
  <p>Command file - pcmd.txt</p>
  
  <pre><code>cd /opt/test/srt
  ./srt.tool 20150506 20150506 &amp;
  exit
  </code></pre>