这个代码已经在一个目录中测试成功,全盘的代码请自已解决,在这个代码中,源文本必须有回车符,否则第二次运行本代码还会追加源文本的内容...
@echo off
setlocal enabledelayedexpansion
set "srcfl=123.txt"
set /p tmp_=<"%srcfl%"
for %%a in (*.txt) do (
set /p temp_=<"%%a"
if not "!tmp_!"=="!temp_!" (
>"%temp%\temp_.txt" type "%%a"
>"%%a" type "%srcfl%"
>>"%%a" type "%temp%\temp_.txt"
)
)
Last edited by moniuming on 2009-2-7 at 20:32 ]