I am having some trouble of comparing an list of files in 1 dir to an list of files in an other dir by date time
What i have so far is this
Code: Select all
@echo off
SETLOCAL EnableDelayedExpansion
REM GETTING FILES IN RESCLIENT
FOR /R e:\Pandoraflyff\Resclient %%A IN (*.*) do (
SET Original=%%~TA
SET FileName=%%A
)
REM GETTING FILES IN PATHCER
set newOrMod=
FOR /R e:\Pandoraflyff\Patcher %%B IN (*.*) do (
SET Compare=%%~TB
SET FileNameCompare=%%B
if !Original! LSS !Compare! ( GOTO OLDER ) ELSE ( GOTO NEWER )
)
:OLDER
echo file !FileName! !Original! is older then file !FileNameCompare! !Compare!
:NEWER
echo !Original! !Compare!
The output is this
e:\Pandoraflyff\Resclient\World\WdVolcanceYellow\Pandora_00.res 11-05-2014 is older then e:\Pandoraflyff\Patcher\Flyff.a.gz 26-05-2014
So it looks to me that the for loop isnt correct. cause it compares 2 different files.
What i need is that its checking all the files in folder1 and its subfolders and compare them to all the files in folder2 and its subfolders
Also it must compare according the file name
so
e:\folder1\file1.res against e:\folder2\file1.res.gz
e:\folder1\file2.res against e:\folder2\file2.res.gz
And not like the above comparison.
Any help would be appriciated.
Btw files are not going to be changed within 1 minute so there fore i can use an batch file.
With kind regards,
Thomas de Vries