that is because you created origin.txt in the directory where your code is searching for all txt files. Try substitute the following lines for your code.- if exist d:\test1\tmp\origin.txt. (del d:\test1\tmp\origin.txt.)
- for /r d:\test1\tmp\ %%i in (*.txt) do (
- type %%i >>d:\origin.txt
- @echo merging with %%i
- )
复制代码
|