我想使用带有普通代理的SOCKS5连接将文件上传到FTP。
我正在Windows服务器上工作。我.txt
的我.bat
实际上看起来像:
open proxyhost
proxyuser
proxypassword
user [email protected]
ftppassword
bin
mput \\upload\path\to\*.pdf
quit
我正在使用以下.txt
文件打开文件:
ftp -i -s:"\\path\to\mytxt.txt" >"\\path\to\ftp.log"
find "226" "\\path\to\ftp.log" && goto finished || goto error
:finished
exit 0
:error
exit 1
现在的问题是:有没有办法在其中使用SOCKS5 .txt
?
我在Google上什么也没找到。
也许你可以帮帮我。非常感谢。
最好的祝福
Windows内置的ftp.exe
FTP客户端不支持任何代理(您在脚本中使用的FTP代理是透明代理,FTP客户端甚至不知道它存在)。
您必须使用另一个命令行FTP客户端。
例如,使用WinSCP脚本:
winscp.com /log="\\path\to\ftp.log" /command ^
"open ftp://ftpuser:[email protected]/ -rawsettings ProxyMethod=2 ProxyHost=proxyhost ProxyUsername=proxyuser ProxyPassword=proxypassword" ^
"put \\upload\path\to\*.pdf" ^
"exit"
if errorlevel 1 goto error
exit 0
:error
exit 1
有关详细信息,请参见:
(我是WinSCP的作者)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句