#1. 下载 psftp 工具:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
#2. psftp 使用便捷方法:
将psftp.exe 的路径加入到环境变量中,这样在win+R/cmd line 中就可以直接使用psftp.
写bat 文件如下:
psftp ***.***.***.IP* -l name -pw password
关于psftp的选项参数说明可以直接在命令行中输入psftp -h查看:
C:\Users\*** >psftp -h
PuTTY Secure File Transfer (SFTP) client
Release 0.62
Usage: psftp [options] [user@]host
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-b file use specified batchfile
-bc output batchfile commands
-be don't stop batchfile processing if errors
-v show verbose messages
-load sessname Load settings from saved session
-l user connect with specified username
-P port connect to specified port
-pw passw login with specified password
-1 -2 force use of particular SSH protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-batch disable all interactive prompts
因为psftp 无法自动补全文件名,可以使用-b 选项指定要下载的文件。
That's all !