bagkmfk.blogg.se

Compare contents of two folders
Compare contents of two folders




:: If you remove the 3 lines above, then you need to replace the 2 below variables with values :: the next 3 lines are only needed if you want to predefine multiple directories for comparison Set environment=D:\path\to\parent directory containing the different tree structures (if they do not share a parent, then make this the drive)

compare contents of two folders

Set Output=D:\path\to\where your want to view your\Output_Files Set Resource=D:\path\to\batch_file_home\Resource_Files Set Input=D:\path\to\batch_file_home\Input_Files :: set a workspace location for the script outside of the trees being reviewed :: This script compares the contents of 2 trees If the directory trees have different parents, then read through the scripts comments. If both directory structures are under the same parent, then all you need to do is update the first 8 variables in the script. and creates a folder with a diff file for each non-matching object.creates a list of the file differences (named File_differences.txt in the output folder).takes 2 directory trees and compares each file in each tree.I modified a batch file I wrote for a CD process that should meet your need. S L O W :/Īt this point, a batch file makes sense: off The simplest solution is to use FORFILES instead, since it directly supports relative paths. The problem is getting the relative paths so that the hierarchy can be applied to another root. It is easy to iterate the folder hierarchy for a given root using FOR /R.

compare contents of two folders

Enter HELP FC or FC /? from the command prompt to get more information.Įxtending the solution to support subfolders is a bit tricky. There are a number of options to the FC command. Extra files in folder2 are simply ignored. The command will report on files that exist in folder1 but are missing in folder2. You can be more specific for the file mask in the first folder if you want. A single FC command can do what you want: fc folder1\* folder2\*






Compare contents of two folders