C:\adc_ftp>ftp sysadmin:ftp@localhost <----Looking for a 1 line login like this
Unknown host sysadmin:ftp@localhost. <---doesn't work
ftp> bye
这可行但不是我想要的登录方式:
C:\adc_ftp>ftp localhost
Connected to myPC.xxx.com.
220-FTP server
WarFTPd 1.82.00-RC11 (Sep 22 2006) Ready
(C)opyright 1996 - 2006 by Jarle (jgaa) Aase - all rights reserved.
220 Please enter your user name.
User (myPC.xxx.com:(none)): sysadmin
331 User name okay, need password.
Password:
230 User sysadmin logged in from host localhost (127.0.0.1)
ftp>
我正在尝试制作一个用于登录 ftp 服务器的批处理文件。我尝试过以下示例 这个,但它不接受登录信息,只是停留在“请输入您的用户名”。
答案1
来自你提到的例子,请务必使用-n禁用自动登录的标志
C:\adc_ftp>ftp -n -s:ftp_script.txt localhost
在哪里ftp_脚本.txt包含如下内容:
user
ftp
ftppassword
Some ftp commands...
quit
答案2
为此,您需要创建一个文本文件。
例如,要获取位于ftp://ftp.kernel.org/pub/README
此处的文件,这是我的文本文件:
open ftp.kernel.org
anonymous
[email protected]
get /pub/README
bye
然后我使用参数调用 ftp -s
,例如:
C:\Documents and Settings\eleven81\Desktop>ftp -s:ftp.txt
这对我来说非常有效。
答案3
一步自动登录Filezilla:
- 在 Filezilla 中创建站点配置文件,指定用户名和密码(如果您还没有)
- 在某处创建 Filezilla 的快捷方式。(我的快捷方式在快速启动栏上)
- 右键单击快捷方式以进入其属性。
- 附加末尾目标带有
--site="0yoursiteprofile"
。0
表示这是一个已保存的配置文件(与默认配置文件相反)。
整体目标字段应该是这样的:
"C:\Program Files\FileZilla FTP Client\filezilla.exe" --site="0yoursiteprofile"
如果你的个人资料名称中包含空格、斜线和其他符号,则可能需要对其进行转义,因此请避免使用它们,或者阅读更多有关Filezilla 的命令行开关。
就这样——只需单击快捷方式即可启动并登录!
笔记在 Filezilla 的快捷方式属性中,你还可以添加快捷键组合如果需要的话。
答案4
这对我有用
================ ftp.txt =================
open "ftp.ZZZZZ.com"
user "username" "password"
cd public_html
prompt
hash
put thursday.htm
cd thursday_files
lcd thursday_files
mput *
bye
=============================================
ftp -n -s:ftp.txt