tags:

views:

1027

answers:

4

How do I compare two directories on cmd prompt of Windows m/c? I want equivalent of diff -r of UNIX.

+1  A: 

The comp command for Windows is what you're looking for.

Here the example:

To compare the contents of the directory C:\Reports with the backup directory \\Sales\Backup\April, type:

comp c:\reports \\sales\backup\april
victor hugo
+1  A: 

Install Cygwin and you can use diff -r on Windows.

RichieHindle
A: 

The easiest way would probably be downloading diff for Windows: http://gnuwin32.sourceforge.net/packages/diffutils.htm
You could also do something like:

dir directory1 > dir1
dir directory2 > dir2
comp dir1 dir2

Also, some versions of Windows comes with windiff, however that is a GUI tool

carlpett
+1  A: 

You can use windiff util included in Windows from NT version and up. Just run 'windiff' and a graphic tool will pop up.

File -> Compare directories

http://msdn.microsoft.com/en-us/library/aa266122(VS.60).aspx

This article describes how to use it from command line. Great benefit of this tool is that it is already included and you don't need to download and install anything.

Ivan Suhinin