"sftp" 未被识别为内部命令

"sftp" is not recognized as an internal command

我正在尝试使用批处理文件中的以下命令连接到 FTP 服务器:

SFTP -b upload_parent_child_report.ftp mhe_ipub@%SERVER_NAME%  >> parent_child_report.log

每当我 运行 批处理文件时,我都会收到错误消息:

'sftp' is not recognized as an internal command.

我检查了 System32 文件夹,但没有找到 sftp
我搜索了我的系统,也没有找到。
我也有 PuTTY,但我需要使用批处理文件自动传输文件。

有什么建议吗

P.S: 我知道已经有一个关于这个的问题,但解决方案对我来说不是很清楚。

sftp.exe 二进制文件默认仅在 Windows 10 版本 1803 及更高版本上可用。 Windows 的旧版本不包含它。

如果你有 PuTTY,你就有 psftp.exe,它与 OpenSSH 兼容 sftp

所以,你可以这样做:

psftp -b upload_parent_child_report.ftp mhe_ipub@%SERVER_NAME%  >> parent_child_report.log

或手动安装 Win32-OpenSSH。在 Windows 10 的旧版本上,它可以作为可选的 Windows 功能安装。在 Windows 的更旧版本上,您可以手动下载它。无需安装,只需解压 ZIP。