I need to write a script for binary comparison of all files within 2 folders recursively. The 2 folders are installation folders and contain same files, but they are installation folders of different versions. I need to find which files (.dll
, .lib
, .exe
) have changed with regard to previous versions.
I have tried using fc
command
fc /b %1\* %2\* > result.txt
But, it compares files only inside the stated folder. I need to recursively compare all files within all folders.
I thought this can be achieved by for
loop.
For /r C:\test\%%f in (*) do @fc /b %%f C:\test\%2\%%~nxf > result.txt
The problem here is %%~nxf
which only gives the file name not the relative path.
I tried using forfiles
command:
forfiles /s /p C:\test\%1 /m * /c "cmd /c @fc /b %1\@relpath %2\@relpath"
@relpath
introduces .\
in the middle of the path, which is messing up my complete path. Any pointers on this one will be highly appreciated.
Please help!