@echo off :: 比较A文件夹和B文件夹下文件名的异同(A和B文件夹下均无子目录) :: 如果有不同,A文件夹中不同的写入a.txt,B文件夹中不同的写入b.txt :: 相同部分的文件名写入c.txt cd.>a.txt cd.>b.txt cd.>c.txt dir /a-d /b "A文件夹的路径">list_a.txt dir /a-d /b "B文件夹的路径">list_b.txt for /f "delims=" %%i in (list_a.txt) do ( find "%%i" list_b.txt>nul 2>nul && echo %%i>>c.txt || echo %%i>>a.txt ) for /f "delims=" %%i in (list_b.txt) do ( find "%%i" list_a.txt>nul 2>nul || echo %%i>>b.txt ) del /q list_a.txt>nul 2>nul del /q list_b.txt>nul 2>nul start a.txt start b.txt start c.txt
@echo off cd.>3.txt for /f "tokens=*" %%i in (2.txt) do ( find "%%i" 1.txt || >>3.txt echo %%i ) start 3.txt
c:\windows\21.txt c:\windows\123.txt c:\my doc
c:\windows\123.txt c:\my doc
Originally posted by hhh246 at 2006-9-4 13:09: 目前还没有人能解决呀,
Originally posted by hhh246 at 2006-9-8 08:52: for /f "delims==" %%i in (1.log) do ( find /i "%%i" "2.log" || echo %%i>>b.txt ) 可以了,但速度相当慢,谁能写出多线程的吗?
findstr /v /x /g:1.txt 2.txt