@echo off
set dir1=%1
set dir2=%2
echo comparing %dir1 and %dir2, not their subdirectories.
if "%dir1%" != "" .and. "%dir2%" != "" goto bothfilled
echo DirDiff needs two directory names without quotes
goto done
:bothfilled
set slop=%@eval[(2 * 1000 * 1000 * 10) + 1]
for /a:-d %i in (%dir1\*.*) do (
set file2=%dir2\%@FILENAME[%i]
if exist %file2 (
rem truncate difference to 2 second increments
set diff=%@EVAL[ (%@FILEAGE[%i] - %@FILEAGE[%file2]) \ %slop ]
if %diff GT 0 (
echo %i is newer ) else (
if %diff LT 0 (
echo %i is older ) else (
rem match
if %@FILESIZE[%i] EQ %@FILESIZE[%file2] (
rem echo %i is the same
) else (
echo %i has a different length )))) else (
rem extra file in dir1
echo %i has no match
))
for /a:-d %i in (%dir2\*.*) do (
set file1=%dir1\%@FILENAME[%i]
if not exist %file1 (
rem extra file in dir2
echo %i has no match ))
:done