How to compare two folders in Win 7 prof 64bit

Anonymous
2010-01-13T19:30:57+00:00

I have two folders which has multiple files. I would like to compare both folders and see which folder has more files and what are their names? How do I do that in Win 7 prof 64bit? Is their any utility that I can download?

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-11-13T17:55:25+00:00

Hey dude-

Here's the right way to do it, without the external downloads.  It looks like a lot at first, but once you've done it, it's very easy.  It works in all Windows versions from 7 back to 95.  For our example assume that you're comparing two directories named 'A' and 'B'.

  1. run cmd.exe to get a command prompt.  (In Windows 7, the powershell won't work for this, FYI.)  Then do it again, so that you have two of them open next to each other.
  2. in each window go to the directories that you want to compare.  (Using 'cd' commands.  If you're not comfortable with this, then you should probably go with the external utilities, unless you want to learn command prompt stuff.)
  3. type 'dir /b > A.txt' into one window and 'dir /b > B.txt' into the other.  You'll now have two text files that list the contents of each directory.  The /b flag means bare, which strips the directory listing down to file names only.
  4. move B.txt into the same folder as A.txt.
  5. type 'fc A.txt B.txt'.  The command 'fc' means file compare.  This will spit out a list of the differences between the two files, with an extra line of text above and below each difference, so you know where they are.  For more options on how the output is formatted, type 'fc /?' at the prompt.  You can also pipe the differences into another file by using something like 'fc A.txt B.txt > differences.txt'.

Have fun.

Was this answer helpful?

200+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2010-01-14T18:43:08+00:00

Gujju dude,

Welcome to Microsoft Answers.

If you hover the pointer over the folder, it will display folder size and file information. If you do not have this activated, go to windows explorer > organize drop down > folder and search options > view > Select the Display file size information in folder tips check box, and then click OK.

I hope this helps.


Lisa

Microsoft Answers Support Engineer

Visit our Microsoft Answers Feedback Forum and let us know what you think.

Was this answer helpful?

60+ people found this answer helpful.
0 comments No comments

84 additional answers

Sort by: Newest
  1. Anonymous
    2013-03-02T11:53:35+00:00

    RE: SUBDIRECTORIES: Yes! Use 'dir /s /b > A.txt' and 'dir /s /b > B.txt'  You can also (rather than bare format) get a lot of other formatting options.  Just type 'dir /?' at the Command Promt to get a full list of everything you can put after 'dir' (which stands for "Directory" -- simply a command that says "Give me a directory listing of the contents of the folder I'm "in" currently")

    RE: PLACING FOLDERS SIDE-BY-SIDE, EXACTLY TOUCHING:

    There is! :-)

    Open two Explorer windows which show the folder(s) you want to compare.  Then just drag the title bar of either window to the left of your screen (hit the edge with your mouse) and you'll see the outline of the window show up to take up exactly half the screen on the left.  Let go of your mouse button and the window pops into exactly the LEFT 50% of the screen real estate (CMD Prompt windows don't QUITE take up 50% on a wide screen because they have a maximum fixed width but Explorer windows work fine)

    Do the same for the other Explorer window showing your folder, but this time to the RIGHT -- .. Click the title bar, drag to your right, hit the edge and let go.) and voila! you've got two windows perfectly matched to compare.

    Also works to drag the window up to the top of your screen and hit the edge to go full screen (maximized) view.

    Another *neat* little trick is if you want to ONLY show one window on your screen and minimize everything else, just grab the title bar with your mouse and SHAKE THE WINDOW REALLY HARD.  Everything but the window you're holding on to will minimize.  To bring everything back up, just shake your single Explorer window again and it all restores.

    All this having been said -- I agree with JB-Spain to a degree... I mean THANKS for putting these nifty window tricks in place -- but I really would have rather had some real power-user / file management tools in place. :-)   My friends all think I'm some sort of programmer / hacker phreak because I am constantly just opening up CMD Prompt and using Robocopy (hence my screenname) or the standard tools in CMD Prompt to do my work -- it has so much more available if you know what you're doing -- and I've been using DOS since about the time most of my coworkers were born. ;-)

    Hope this helps!

    Robo

    Hi Robo,

    I didn't know about the shake window trick and the compare windows thing - many thanks.

    Incidentally on my twin screen system I have to move one window to the extreme left of the left screen and the other to the extreme right of the right screen! So I get two half screens to compare with two half screens of space between them! It's easy to stretch them to full screen width, but I wonder why it doesn't do that automatically?

    I'm assuming this just lets me look at the two folders and doesn't have any neat tricks for highlighting differences.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-10-17T11:18:57+00:00

    http://www.karenware.com/powertools/ptdirprn.asp

    Karen's Directory Printer could be a good option.  I've been using it since 2005.  Pulling the text results from the program into two columns in a spreadsheet usually helps me narrow down differences, especially if the properties of each folder only show a few discrepancies to have to manipulate the spreadsheet for a row match up if sorting alphabetically or doing a column comparison.  Running an IF statement is the easiest.  I just did one with 65,536 rows with =IF(B1=J1,"ok","error") and then just sort by that column and go through the "error" being careful to do so in a different tab, since it'll also sort the folder rows which you'll need to find which folder that file is in (which a "find" can discover for you in the first tab) of the spreadsheet.

    EDITED....................

    Hmmmmm, I just found a glitch in my system.  It seems my Excel 2002 is row limited at 65,536 rows and not all of the notepad text would copy over.  So I suppose I would have to do only several folders at a time rather than all of them.

    FYI..............

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-08-02T03:43:16+00:00

    Anyways, the answer using command promtp is the most powerful & correct one, Lisa's answer is a waste of bandwidth.  Also another & more GUI-style solution is to use XYcommander or some powerful replacement for stock Windows Explorer or Linux, to do folder bitwise comparison, even in WIndows explorer you can extract Folder Tree with Ctrl or Alt (i forgot?) and Shift key while selecting a folder or file-group within a folder.

    Was this answer helpful?

    0 comments No comments