I have tried the below code to compare 2 Drives,(D:
and M:
), which contain the same set of directories, subdirectories and files. Currently I'm getting output in a.txt
file like no difference found
for files which are similar and getting what content is different for unmatched file.
@echo off
SET Source_Cal_Folder=D:\A\B\C\D
SET Target_Cal_Folder=M:\A\B\C\D
set "fileMask=*"
echo Deleting log file...
del a.txt
echo Comparing files in Cal directory...
for /f "delims=" %%F in ('echo "."^&forfiles /s /p "%Source_Cal_Folder%" /m "%fileMask%" /c "cmd /c if @isdir==TRUE echo @relpath"') do fc "%Source_Cal_Folder%\%%~F\%fileMask%" "%Target_Cal_Folder%\%%~F\*" >> "a.txt"
echo Verify if Cal files are the same...
find /C "Files are different sizes" "a.txt"s
echo done
Requirement:
- One output should contain no difference files path and another output text file should contain only the path of not matched files, (no content of the file).
- In Command Prompt I'm getting a message like
no such folder or file
for certain folders, though it is there.
Can anyone help me to resolve this?