批处理文件上传到名为.txt FTP [英] Batch File To Upload .txt to FTP

查看:148
本文介绍了批处理文件上传到名为.txt FTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了这个独立的FTP帐户​​。

I have setup a separate FTP account for this.

下面是信息:

FTP Username: ahk@proflightsimulatoreview.com
FTP Server: ftp.proflightsimulatoreview.com
FTP Server Port: 21
FTP Password: ahktest

Text file i want to upload: C:\Users\Kyle\Desktop\ftptest\thetest.txt

请告诉我怎么用批处理做到这一点。我的理解是,你做一个单独的txt文件的FTP命令,然后使用一个批处理文件来运行它。嗯,我必须在正确的信息,因为它没有工作,也没有插好。

Please show me how to do this with batch. My understanding is that you make a separate txt file with the FTP commands and then you use a batch file to run it. Well I must have not plugged in the info right because it didn't work.

所以在这里我给你的信息。请告诉我如何上传文本文件。

So here I am giving you the information. Please show me how to upload a text file.

推荐答案

我只是把hello.txt的在你的FTP根通过;

I just put HELLO.TXT in your ftp root by;

1 即可。保存此为 MYFTP.bat

@echo off
echo user ahk@proflightsimulatoreview.com> ftpcmd.dat
echo ahktest>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat ftp.proflightsimulatoreview.com
del ftpcmd.dat

2 。从作为命令行,在同一个目录 MYFTP.BAT ,运行;

2. From the command line, in the same directory as MYFTP.BAT, running;

MYFTP.BAT c:\temp\hello.txt

结果

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 50 allowed.
220-Local time is now 05:17. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
ftp> user ahk@proflightsimulatoreview.com
331 User ahk@proflightsimulatoreview.com OK. Password required

230-OK. Current restricted directory is /
230 0 Kbytes used (0%) - authorized: 51200 Kb
ftp> put hello.txt
200 PORT command successful
150 Connecting to port 59363
226-0 Kbytes used (0%) - authorized: 51200 Kb
226-File successfully transferred
226 0.563 seconds (measured here), 14.20 bytes per second
ftp: 8 bytes sent in 0.34Seconds 0.02Kbytes/sec.
ftp> quit
221-Goodbye. You uploaded 1 and downloaded 0 kbytes.
221 Logout.

这篇关于批处理文件上传到名为.txt FTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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