Hello. Im trying to make a batch file that goes through two directors and writes to a txt document all the files that exist in one that dont exist in the other. I have it ALMOST working but i cant figure out how to get it to go down in folders to compare the rest of the directory. Any he[lp would be nice, THANKS!
Code:
@echo off
setlocal ENABLEDELAYEDEXPANSION
Set dirA=%1
Set dirB=%2
dir /B /O %dirA% >dirA.txt
dir /B /O %dirB% >dirB.txt
Echo. >>AnotinB.txt
find /V /C "this_is_an_absurd_string" dirB.txt >numlines.txt
for /f "tokens=3 delims= " %%B in (numlines.txt) do set /A maxnum=%%B
for /F "tokens=* delims= " %%A in (dirA.txt) do (
find /V /C "%%A" dirB.txt >numlines.txt
for /f "tokens=3 delims= " %%B in (numlines.txt) do set /A foundnum=%%B
if %maxnum%==!foundnum! echo %%A >>AnotinB.txt
)
copy /B AnotinB.txt dupli.txt >nul
more dupli.txt
for %%A in (dirA.txt dirB.txt AnotinB.txt numlines.txt) do (
if exist %%A del %%A
)