I am able to download files from SFTP in CMD
window, by using following code:
WinSCP.com
# Connect to the host and login using password
open user:pw@address
# get all the files in the remote directory and download them to a specific local directory
lcd C:UsersxxDesktop
get *.xlsx
# Close and terminate the session
exit
I searched online and found out that I can put these codes in a bat
file and use
Call Shell("cmd.exe /c C:UsersxxDesktopWinSCPGet.bat", 1)
However, only the first line of the bat file WinSCP.com
is being executed. It will pop up the cmd
window, showing this, without doing anything else.
How to execute all the lines at one time?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…