用SFTP替换Windows命令FTP -s:E:\FtpScript.txt? [英] Replace Windows command FTP -s:E:\FtpScript.txt with SFTP?
问题描述
我有以下Windows脚本连接到常规FTP服务器并下载文件。
然而,这些文件已经被移至SFTP服务器。我如何修改以下脚本以连接到这个新的安全FTP服务器?我真的不想修改太多,因为它已经与以前的FTP服务器正常工作。
我在这里使用的ftp客户端是Windows中包含的ftp客户端。
脚本:
我有一个Windows任务运行以下命令: FtpScript.txt 包含以下内容: Windows命令行FTP客户端不支持SFTP协议。 您可以切换到WinSCP: 替换您的命令行with: ftp -s:C:\files\FtpScript.txt
命令
打开web.myserver.com 8021
用户名
密码
lcd / Data / 2014/0113
提示符
get / var / opt / Data1200.xml
get /var/opt/Data1300.xml
get / var / opt / Data1400xml
winscp.com /script=C:\files\FtpScript.txt
$ c
$ li $ <$> 打开sftp://用户名:password@web.myserver.com/
lcd
可以保留(虽然 / Data / 2014/0113
看起来不像本地路径)
get
需要一个目标路径,使用 .\
退出
有关详细信息,请参阅使用Windows批处理脚本的Secure FTP或WinSCP指南用于将Windows FTP脚本转换为WinSCP SFTP脚本
(我是WinSCP的作者)
I have the following Windows script that connects to a regular FTP server and downloads files.
However, the files have since been moved to an SFTP server. How can I modify the following script so that it connects to this new secure ftp server? I really don't want to modify too much since it had been working correctly with the past FTP server.
The ftp client I'm using here is the one that's included with Windows.
I'm including the script:
I have a Windows task that runs the following: ftp -s:C:\files\FtpScript.txt
FtpScript.txt has the following contents:
open web.myserver.com 8021
username
password
lcd /Data/2014/0113
prompt
get /var/opt/Data1200.xml
get /var/opt/Data1300.xml
get /var/opt/Data1400xml
Windows command line FTP client does not support SFTP protocol.
You can switch to WinSCP:
replace your command line with:
winscp.com /script=C:\files\FtpScript.txt
replace your connection and authentication commands with:
open sftp://username:password@web.myserver.com/
the
lcd
can stay (though/Data/2014/0113
does not look like a local path)- in WinSCP the
get
needs a target path, use.\
to download to the local current working directory. - add the
exit
command
For details, see Secure FTP using Windows batch script or WinSCP guide for Converting Windows FTP script to WinSCP SFTP script
(I'm the author of WinSCP)
这篇关于用SFTP替换Windows命令FTP -s:E:\FtpScript.txt?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!