views:

62

answers:

3

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.

+1  A: 
>diff -r Folder_A Folder_B

You may find GNU diffutils compiled for windows at GnuWin32.

ephemient
+1  A: 

I use Cygwin's versions of the Unix command line tools:

diff -r dir1 dir2

I've also used MinGW in the past. Both have a few gotchas, but are "close enough." For visual diffs, I like WinMerge pretty well.

Michael Brewer-Davis
+1  A: 

There is the built in command COMP that you could use. It depends a little bit on what you actually want to compare.

Compares the contents of two files or sets of files.

COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C]

data1 Specifies location and name(s) of first file(s) to compare.

data2 Specifies location and name(s) of second files to compare.

/D Displays differences in decimal format.

/A Displays differences in ASCII characters.

/L Displays line numbers for differences.

/N=number Compares only the first specified number of lines in each file.

/C Disregards case of ASCII letters when comparing files.

To compare sets of files, use wildcards in data1 and data2 parameters.

Use a syntax like COMP c:\folder1 c:\folder2 to compare all files in folder1 with the content of folder2. If you need to recurse into the subdirectories, you need to use a batch script using a FOR loop and the PUSHD and POPD command.

Just leave a comment, if you need help with that.

Frank Bollack