Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare files and folders

Status
Not open for further replies.

jeroen1

Technical User
Apr 25, 2005
12
NL
Hi,

We use a couple of scripts that install several applications, copy's files, set registry settings, and so on... Now I'm working on a script that checks to see if the server installed ok. One of the parts that I would like to check is a comparison of a local directory and a network folder (that should have copied locally). I've been breaking my brain on several methods on doing this, but nothing good so far and was hoping to find some help here.

What I've come up with, so far is scanning the two folders (recursively), putting this information in two arrays and compare one with the other. This is just theoretical though, because uptil now I've only succeeded in recursively scanning the folder.

regards,

jeroen
 
What criteria do you want to compare by? Will the number of files and folders do (pretty simple, I'd have thought) or do you want to compare file sizes (less simple, I'd have thought!)?

JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
 
I have used two dictionaries in the past to compare two folders. If you want to avoid writing your own solution, just use RoboCopy with a /L flag and it will tell you if there are differences without actaully doing any copying.


[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top