[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! :wave:
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?
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.
Re: [2008] Compare Folders and Files Recursively
I found an article here. You can get some guidelines from this.
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?
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.