(Windows)用于连接文件的批处理文件

时间:2014-10-18 18:05:21

标签: windows batch-file concatenation batch-processing

我有一个包含子文件夹层次结构的文件夹。最低级别的子文件夹包含文件。

现在,我对.bat文件(对于Windows)感兴趣,该文件获取特定名称的所有文件,例如test.log,在文件夹hiearchy中并连接它们并在调用.bat的位置创建一个新文件。

这怎么可能?

非常感谢。

1 个答案:

答案 0 :(得分:1)

(for /f "delims=" %%a in ('dir /a-d /s /b "c:\root\folder\test.log"') do type "%%~fa") > "%~dp0\joined.log"

使用dir列出所需文件,并为列表中的每个文件键入它,并将所有输出发送到批处理文件文件夹中的文件。

相关问题