0

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:

  1. 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).
  2. 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?

User8787
  • 1
  • 1
  • 2
    Your question is listing four different requirements, please choose only one which requires our assistance, and show us the code you've written to achieve it. The code you've posted just outputs everything to one file, we're not here to write for you code which does something else, we're here to help you to fix a problem with your code which has already tried that something else! – Compo May 21 '21 at 13:48
  • The code I added above I have done for printing one file all paths but I am struggling to change the code to print in other text when it is different. If I edit anything I m getting error. The Req 3 is my concern. From the above code I have achieved first 2. – User8787 May 21 '21 at 14:33

0 Answers0