shell - How to chain psftp commands in one single windows command line -


i need run chain of commands

psftp xx.xx.xx.xx -l xxx -pw yyy cd zzzzzz file.csv bye 

in 1 single command line

(psftp comes here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)

i have seen on superuser (https://superuser.com/a/532528/290138) ftp can don't understand how works:

echo open xx.xx.xx.xx >> ftp & echo user xxx yyy >> ftp & echo binary >> ftp & echo file.csv >> ftp &echo bye >> ftp & ftp -n -v -s:ftp & del ftp 

thanks!

[edit]
wrote 4 lines in .bat file , ran it.
first line executes well, psftp interpreter opens (it's ftp interpreter)
, second line never happen

i figured out finally:

create .bat file this:

cd x:\where\you\want\to\download  @echo off  @echo cd xxx > psftp.txt @echo yyy.csv >> psftp.txt @echo bye >> psftp.txt  psftp xx.xx.xx.xx -l login -pw pw -b psftp.txt  del psftp.txt 

or chain of these & have in 1 line.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -