@setlocal
@set TEMPDBG=no
@if "%1x" == "x" goto DNCMD
@if /I "%1x" == "Dx" goto SETDBG
@echo.
@echo ERROR: Unknown command [%1]
@echo ERROR: ONly input is 'D' to set debug ON
@echo.
@goto END

:SETDBG
@set TEMPDBG=yes
:DNCMD

@set TEMPDN=0
@set TEMPS=0
@set TEMPD=0
@set TEMPM=0
@for %%i in (temp\*.dsp) do @(call :CMPIT %%i)

@echo and the DSW file...

@for %%i in (temp\*.dsw) do @(call :CMPIT %%i)

@echo.
@echo Done %TEMPDN% files. %TEMPS% are SAME, %TEMPD% different, %TEMPM% missed...
@echo.

@goto END

:CMPIT
@if "%1x" == "x" goto :EOF
@set TEMPF1=%1
@set TEMPF2=%1.bak
@set /A TEMPDN+=1
@if "%TEMPDBG%" == "yes" @echo %TEMPF1%
@if EXIST %TEMPF2% goto DOCMP
@set /A TEMPM+=1
@echo No %TEMPF2% exists yet...
@goto :EOF
:DOCMP
@fc4 -q -v0 %TEMPF1% %TEMPF2% > nul
@if ERRORLEVEL 1 goto GOTDIF
@set /A TEMPS+=1
@if "%TEMPDBG%" == "yes" @echo Appear the SAME...
@goto :EOF

:GOTDIF
@set /A TEMPD+=1
@REM echo Comparing %TEMPF1%
@REM fc4 %TEMPF1% %TEMPF2%
@echo Diff %TEMPF1%
@REM diff -u %TEMPF2% %TEMPF1%
@REM Looks better - smaller - in this form...
diff %TEMPF2% %TEMPF1%
@echo Check difference...
@pause
@goto :EOF


:END

