Hello,
You can use the following batch script
Code:
Echo Files that are found in BOTH folders %dA% AND %dB% >b.txt
Echo. >>b.txt
findstr /G:dA.txt dB.txt >>b.txt
echo ------------------------------------- >>b.txt
Echo Files that are found in folder %dA% but NOT in folder %dB% >AnotinB.txt
Echo. >>AnotinB.txt
find /V /C "this_is_an_absurd_string" dB.txt >nln.txt
for /f "tokens=3 delims= " %%B in (nln.txt) do set /A maxnum=%%B
for /F "tokens=* delims= " %%A in (dA.txt) do (
find /V /C "%%A" dB.txt >nln.txt
for /f "tokens=3 delims= " %%B in (nln.txt) do set /A foundnum=%%B
if %maxnum%==!foundnum! echo %%A >>AnotinB.txt
)
echo ------------------------------------- >>AnotinB.txt
Echo Files that are found in folder %dB% but NOT in folder %dA% >bnA.txt
Echo. >>bnA.txt
find /V /C "this_is_an_absurd_string" dA.txt >nln.txt
for /f "tokens=3 delims= " %%B in (nln.txt) do set /A maxnum=%%B
for /F "tokens=* delims= " %%A in (dB.txt) do (
find /V /C "%%A" dA.txt >nln.txt
for /f "tokens=3 delims= " %%B in (nln.txt) do set /A foundnum=%%B
if %maxnum%==!foundnum! echo %%A >>bnA.txt
)
echo. >>bnA.txt
echo ------------------------------------- >>bnA.txt
copy /B b.txt+AnotinB.txt+bnA.txt dupli.txt >nul
more dupli.txt
for %%A in (dA.txt dB.txt b.txt AnotinB.txt bnA.txt nln.txt) do (
if exist %%A del %%A
)
Bookmarks