vote up 0 vote down star

Hello,

I want to compare two folders on Windows(Vista, XP) which have large number of huge size files, which i need to compare. If i use beyond compare or such tool to compare the folders it is taking lot and lot of time if i do it manually. I need to add that folder comparison to batch file.

So, On a Windows(XP, Vista), Is there any command(inbuilt dos command) or any 3rd party tool/utility(Commercial or freeware - either) to compare two folders using command line.

-AD.

flag

43% accept rate

3 Answers

vote up 1 vote down

If you just want a very quick yes/no using built in tools, use the "comp" command

It is an old command and it is really only designed for individual files, but it works well - you will need to run it twice as it will only compare for files it can find:

This will compare all files in c:\temp\1 against c:\temp\2, then in reverse:

comp c:\temp\1 c:\temp\2
comp c:\temp\2 c:\temp\1

If a file is in one location but not another, you will see: "Can't open file: c:\temp\2\bla.txt"

If a file is different, it will report it as such, for example "Files are different sizes."

If everything checks out, it will say "Files compare OK".

The reason for running this twice is that it will only check and compare files in the second location that it found in the first, so by running it twice, you search both locations for any files that may only be in one folder.

link|flag
vote up 0 vote down

Beyond Compare can be executed from a script; its command-line syntax is extensive. I don't think every single feature in the UI is provided from the command line, but certainly everything you'd need, I think.

link|flag
vote up 0 vote down

Try robocopy with the /mir (mirror) and /L flags. The /L tells it to list the files without really doing the work.

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.