Results 1 to 6 of 6

Thread: [RESOLVED] [2008] Compare Folders and Files Recursively

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2008
    Posts
    32

    Resolved [RESOLVED] [2008] Compare Folders and Files Recursively

    Hello everyone I am needing to do a compare two directories and every folder and all files under it. I need to check file size and date/timestamp of every file. I need it to return something like directories match if they do and if they do not create a file with the files that are different. I also want to state that the machine I will be doing this on will have .net 2.0 I am working to get this updated but as we all know it is a slow process when it is being done by someone else!

    If it could give something like the following in the file:
    1)C:\folder1\testfile1.txt 04/01/2008 04:00:00AM
    2)Z:\folder1\testfile1.txt 05/15/2008 05:00:00PM

    The 2 would be a mapped drive that I can do but this would be the same folder structure as what is on the current machine. The date/timestamps could be in any format as long as they are the same. Note the C: and Z: should not make the match unsuccessful.

    What I would like to do is have this as a Console Application that I can have them run and it will have everything it needs inside it to do everything I need with no interaction from user that double clicks. Each time I will grab the compare file from an xml file that I will provide for them.

    Can someone please help me out with this?

    Thanks in advance!
    Last edited by jtrout; May 15th, 2008 at 08:43 PM.

  2. #2
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: [2008] Compare Folders and Files Recursively

    what exactly the problem is? Don't u know how to get the file information? You are saying you want to run the application without user interaction... do u want to develop window service kind of application?

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2008
    Posts
    32

    Re: [2008] Compare Folders and Files Recursively

    Quote Originally Posted by Deepak Sakpal
    what exactly the problem is? Don't u know how to get the file information? You are saying you want to run the application without user interaction... do u want to develop window service kind of application?

    No I am needing to be able to take two folders and compare them and generate a report of any differences. I know there is software out there that can do this, but I need to be able to hand user a exe and an xml file (which points the exe back to the compare to folder) and run the exe and it compares a workstation and all it's folders I need to know about back to the compare to folder. Generate a report of any differences, if there isn't any then they are good. If there is differences they screwed something up.

  4. #4

  5. #5
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2008] Compare Folders and Files Recursively

    Do the folder paths ALWAYS remain the same?
    C:\folder1
    Z:\folder1

    Are there sub-folders that need to be accounted for?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  6. #6

    Thread Starter
    Member
    Join Date
    Mar 2008
    Posts
    32

    Resolved Re: [2008] Compare Folders and Files Recursively

    Solved! I used the following example/post I found and have made some modifications to it. I am not making it clone the directories but having it write out to a file for each difference. I am also getting the location of the "master" folder from an xml that I can give and not have to recompile each time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width