如何使用批处理文件进行ftp? [英] How to ftp with a batch file?

查看:32
本文介绍了如何使用批处理文件进行ftp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个批处理文件 ftp 到服务器,读出一个文本文件,然后断开连接.服务器需要用户和密码.我试过了

I want a batch file to ftp to a server, read out a text file, and disconnect. The server requires a user and password. I tried

@echo off
pause
@ftp example.com
username
password
pause

但它从未登录过.我怎样才能让它工作?

but it never logged on. How can I get this to work?

推荐答案

0x90h 的回答帮了大忙...

The answer by 0x90h helped a lot...

我将此文件保存为 u.ftp:

I saved this file as u.ftp:

open 10.155.8.215 
user
password
lcd /D "G:Subfolder"
cd  folder/
binary
mget file.csv
disconnect
quit

然后我运行了这个命令:

I then ran this command:

ftp -i -s:u.ftp

它奏效了!!!

非常感谢伙计:)

这篇关于如何使用批处理文件进行ftp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆