希伯来文件夹上的批处理文件

时间:2017-01-22 11:34:14

标签: windows batch-file cmd

我正在尝试在一些名字可能包含希伯来字符和数字的文件夹上运行文件。

我有一个.bat文件,用于从文件夹复制文件到文件夹: 如果文件夹有英文字母或数字,则运行良好。

我将chcp 1255添加到我的脚本后,它也适用于希伯来语文件夹,但如果它也有数字,它就不起作用(见截图)。 我需要复制到文件夹的文件,所以在这个例子中,我给了myfile1.txt我要复制到所有文件夹 仅供参考我有这个文件夹תקיה 1321321535 并且脚本是

for /d %%a in (C:\Test\*) do copy /y C:\myfile1.txt %%a\

所以它复制到除希伯来文件夹之外的所有文件夹。 任何人都可以解决这个问题吗?

[enter image description here] [enter image description here]

现在使用????时没有显示dir /b因为我添加了希伯来字体,但仍然没有复制文件 enter image description here

1 个答案:

答案 0 :(得分:0)

缺少双引号(目标文件夹包含空格)。阅读Escape Characters, Delimiters and Quotes

d:\bat> pushd "D:\test\Unicode\תקיה"

D:\test\Unicode\תקיה> for /D %a in (*) do @echo %a
12323
תקיה 1321321535

D:\test\Unicode\תקיה> for /D %a in (*) do copy /y 01.txt %a\

D:\test\Unicode\תקיה> copy /y 01.txt 12323\
        1 file(s) copied.

D:\test\Unicode\תקיה> copy /y 01.txt תקיה 1321321535\
The syntax of the command is incorrect.

D:\test\Unicode\תקיה> for /D %a in (*) do copy /y 01.txt "%a\"

D:\test\Unicode\תקיה> copy /y 01.txt "12323\"
        1 file(s) copied.

D:\test\Unicode\תקיה> copy /y 01.txt "תקיה 1321321535\"
        1 file(s) copied.

D:\test\Unicode\תקיה>

当然,在批处理脚本中,双倍%百分号符号如下:

for /D %%a in (*) do copy /y 01.txt "%%a\"
相关问题