提示Windows - 脚本 [英] Prompt Windows - Script
问题描述
我有一个包含多个.txt文件的文件夹( essaénova pasta
)
C:\ xml\UPLOAD\essaénova pasta\35160101660296000130550020000540011858610314.txt
文件夹是一个具有口音( essaéa nova pasta
)的名称,并生成一个脚本来生成所有.txt文件的列表,像这样:
C:\ xml\UPLOAD\essa,nova pasta\35160101660296000130550020000540011858610314.txt。
我需要创建一个FTP脚本,以便从.txt文件列表中进行放置。生成上面。我使用FOR命令并生成列表,但它是这样出来:
用户
密码
putC:\ xml\UPLOAD\essa,nova pasta\35160101660296000130550020000540011858610314.txt/content/UPLOAD/35160101660296000130550020000540011858610314.txt
bye
他给出了一个消息,说明文件不存在,因为它不能识别文件夹的名称( essa,nova pasta
)
我需要我的FTP脚本作为文件夹名称这是新文件夹,即正确的名称并正确管理我的FTP脚本如下:
用户
密码
putC:\xml\UPLOAD\essaénova pasta\ 35160101660296000130550020000540011858610314.txt/content/UPLOAD/35160101660296000130550020000540011858610314.txt
bye
如何
如果所有的文件都来自C:\ xml \UPLOAD\essaé,那么我是否会解决这个问题?
lcdC:\xml\UPLOAD \essaénova pasta\
这样你不会操作重音字符, code> for 循环。
然后你的put语句将如下所示:
put 35160101660296000130550020000540011858610314.txt /content/UPLOAD/35160101660296000130550020000540011858610314.txt
$ b b
如果所有的文件都需要在远程目录 / content / UPLOAD /
中,那么你可以通过改变ftp命令中的目录进一步简化:
cd / content / UPLOAD
然后你的put语句看起来像这样:
put 35160101660296000130550020000540011858610314.txt
您不需要指定文件名两次。
所以要传输这些文件:
C:\xml\UPLOAD\essaénova pasta\ 35160101660296000130550020000540011858610314.txt
C:\xml\UPLOAD\essaénova pasta\anotherfile.txt
C:\xml\UPLOAD\essaénova pasta\yetanotherfile.txt
C:\xml\UPLOAD\essaénova pasta\onemorefile.txt
到远程服务器的目录 / content / UPLOAD
:
b $ b password
lcdC:\xml\UPLOAD\essaénova pasta\
cd / content / UPLOAD
put 35160101660296000130550020000540011858610314.txt
put anotherfile .txt
put yetanotherfile.txt
put onemorefile.txt
bye
I have a folder (essa é nova pasta
) with multiple .txt files in it
C:\xml\UPLOAD\essa é nova pasta\35160101660296000130550020000540011858610314.txt
The folder is a name that has accent (essa é a nova pasta
) and made a script to generate a list of all the .txt files, but looked like this:
C:\xml\UPLOAD\essa ‚ nova pasta\35160101660296000130550020000540011858610314.txt.
I need to create an FTP script to make a put to from the list of .txt files. generated above. I used the FOR command and begot the list but it came out like this:
user
password
put "C:\xml\UPLOAD\essa ‚ nova pasta\35160101660296000130550020000540011858610314.txt" /content/UPLOAD/35160101660296000130550020000540011858610314.txt
bye
He gave a message that the file does not exist, because it does not recognize the name of the folder (essa ‚ nova pasta
)
I need my FTP script exit as the folder name "this is new folder", ie, with the correct name and manages my FTP script correctly as follows:
user
password
put "C:\xml\UPLOAD\essa é nova pasta\ 35160101660296000130550020000540011858610314.txt" /content/UPLOAD/35160101660296000130550020000540011858610314.txt
bye
How do I solve this problem?
If all your files come from "C:\xml\UPLOAD\essa é nova pasta\" then you can (once, at the top) run
lcd "C:\xml\UPLOAD\essa é nova pasta\
That way you're not manipulating the accented character in a for
loop.
Then your put statements will look like this:
put 35160101660296000130550020000540011858610314.txt /content/UPLOAD/35160101660296000130550020000540011858610314.txt
If all your files need to end up in the remote directory /content/UPLOAD/
then you can further simplify by changing to that directory in the ftp command like this:
cd /content/UPLOAD
Then your put statement looks like this:
put 35160101660296000130550020000540011858610314.txt
You don't need to specify the filename twice that way. So to transfer these files:
C:\xml\UPLOAD\essa é nova pasta\35160101660296000130550020000540011858610314.txt
C:\xml\UPLOAD\essa é nova pasta\anotherfile.txt
C:\xml\UPLOAD\essa é nova pasta\yetanotherfile.txt
C:\xml\UPLOAD\essa é nova pasta\onemorefile.txt
to the remote server's directory /content/UPLOAD
:
user
password
lcd "C:\xml\UPLOAD\essa é nova pasta\"
cd /content/UPLOAD
put 35160101660296000130550020000540011858610314.txt
put anotherfile.txt
put yetanotherfile.txt
put onemorefile.txt
bye
这篇关于提示Windows - 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!