在SFTP批处理过程中显示FTP服务器响应代码(PSFTP.exe)

时间:2013-01-29 07:30:19

标签: vbscript ftp cmd sftp

有没有办法在PSFTP.exe中显示/输出FTP服务器响应代码?

FTP服务器响应代码示例:

226 Transfer OK

200 Command okay

我的代码:

psftp.exe username@hostname -pw password -v -b batch_file > output_file 2>&1

batch_file:

put some_file
quit

OUTPUT_FILE:

Looking up host "....."
Connecting to ..... port 22
Server version: SSH-2.0-OpenSSH_3.9p1
We claim version: SSH-2.0-PuTTY_Release_0.60_(Centrify_GSS_1.4)
Using SSH protocol version 2
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-rsa 1024 ....
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username ....
Sent .....
Access granted
Opened channel for session
Started a shell/command
Sent EOF message
Server sent command exit status 0
Disconnected: All channels closed
Connected to ......
Remote working directory is ....
local:some_file => remote: some_file_path_on_server

1 个答案:

答案 0 :(得分:1)

您正在连接到SSH服务器,而不是FTP服务器,因此您无法获得FTP服务器状态代码。虽然名称相似,但SSH File Transfer Protocol与FTP基本不同。