title: Tera term macro how to SCP a file
body: <p>Does anyone know if TERA TERM allows me to copy a file on my server to my local PC?
  My job does not allow me to install any other software on this server, so I plan to create a macro with whatever tera term offers.</p>
  <p>For example, I want to copy a file name test.bin located in /tmp to my PC C:\test\logs.</p>
  <p>I tried using TERA TERM &quot;SCPSEND,&quot; but it did not work; it gave me a pop box with the error &quot;File open error.&quot; I assume this command is only meant to copy files into the host server, not from the host server to my local PC.</p>
  <pre><code>SOURFILE  = '/tmp/test.bin'
  DESTFILE  = 'C:\test\logs'          
  
  ;; Send a file.
  scpsend SOURFILE DESTFILE
  ;; Confirm a scp process.
  do
    mpause 5000
    sprintf2 str 'ps -ef |grep -v grep |grep -c scp'
    sendln str
    waitln '0' '1'
  loop while result != 1
  ;; Do next macro after finishing the file sending.
  sendln 'echo SCP finish'
  ;; Exit this macro script.
  end
  
  </code></pre>