Compare Files With Windiff
Microsoft Windiff - To Compare Folders and Files
Don't you just love utilities with expressive names such as Windiff? The words Windows and Difference lead us to the concept of to comparing files and highlighting and disparity. As with other tools, the benefit of Windiff comes from imagining scenarios when it would solve your problems.
To get your copy of Microsoft's Windiff, either extract it from the Windows Server 2003 Support folder, or else download a free copy at the bottom of this page.
Topics for Windiff Compare Folders
Judging from my postbag, not many people realize the benefits of comparing files with Windiff. However, like the all the best ideas, once you understand the concept it becomes blindingly obvious.
Let us take the situation where we want to find a particular setting in the registry, for example, a setting on the Winlogon message box that we wish to control. Here is the outline of our plan:
I find that while Windiff is easy to get working, nevertheless, it leaves me with that lingering feeling that I never quite reach the bottom of its possibilities. For example, I rarely use Windiff for copying files.
Let us start with Windiff's number one job, comparing files. When you first launch Windiff, be aware of a pair of almost identical menus. Go slowly. Be ready for Windiff to ask for the name of the two files in quick succession. I emphasise this sequence because when I was a greenhorn, I thought either I was going mad, or Windiff had a bug. My salvation was reading the screen, Select First File, then Select Second File - phew it's that easy to get started.
Once you have loaded the two files, I expect you want Windiff to identify the differences. The trick is to click on 1 .\filename and then click on Expand.
As ever, Microsoft provide two ways of doing everything, and you could click on the Expand Menu and then select, 'Both files'.
At the business end, Windiff homes in on every tiny difference between the two files. Moreover, for easy reading, it highlights each difference with a different color. The color coding extends into the margin so you can see which file corresponds to the red highlight and which to the yellow highlight.
If a line is the same in both files it only has one entry, which you see in normal black text. Where there are differences, not only do you have the exceptions highlighted, but it gives you the line number.
The screen shot is taken from a regedit export. As I mentioned earlier, one of my classic uses of Windiff is finding where in the registry Microsoft store particular settings.
SolarWinds' Network Performance Monitor will help you discover what's happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
Perhaps the NPM's best feature is the way it suggests solutions to network problems. Its second best feature is the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you give this Network Performance Monitor a try.
After doing its best to match the files line-by-line, Windiff looks at the remaining parts. Where there are sections which are different, but which correspond, in the sense that the part before and the part after match, Windiff has a choice between displaying the lines as blocks or as interleaved.
Windiff uses a heuristic intelligence to decide whether the lines from the two files are similar. If it judges that they are similar it displays them interleaved, otherwise it displays them as blocks.
A secondary job for Windiff is to compare whole folders or directories. Just click on the File menu and select 'Select Directories'. This time you see both directories one under the other so there is no chance of confusion.
Press F8 to see the next change / difference.
Although there is nothing really exciting in the Options menu, they are worth checking. For example, if you remove the tick next to 'Show Identical Lines, it will help you track a single change in large files. In addition to the options, check out the Expand menu and decide if you need to add or remove any of those options.
Windiff's Mark Menu
It is easy to overlook the Mark menu. The job of this menu is to hide or exclude files in your search.
Windiff Command Line Options
My old friend 'Barking' Eddie insisted that I added this Windiff command line section. As I may have mentioned in previous Eddie is an ex-UNIX man and is a founder of 'Dos Diehards'.
Windiff Command Line Options:
This freeware monitor is great for checking whether your network's load-balancing is performing as expected, for example, are two interfaces are getting about equal traffic?
It's easy to install and straightforward to configure. You will soon be running tests to see how much network bandwidth your applications consume.
The GUI has a lovely balance between immediate network traffic data in the middle, combined with buttons to seek related data and configuration settings. Give this monitor a try, it's free!
If you need more comprehensive
network analysis software:
PowerShell Example To Compare Two Files
Here is a PowerShell equivalent of Windiff compare files. As a vehicle to test this script, let us pretend that you have a shopping list.
ShopList: Save these 10 items into a text file, I called mine C:\temp\ShopList.txt
Checkout: Save these 7 items into a text file, I called mine C:\temp\Checkout.txt
Now we are ready to execute this Compare-Object script. My favoured method is to save these instructions into a cmdlet with a .ps1 extension, then call the file from the PowerShell command line. Alternatively, copy the following lines and then paste into the command line.
# Microsoft PowerShell Compare-Object Example
Note 1: You could add the explicit parameters: -referenceObject
-differenceObject and thus substitute this for the last line of Example
The reason that I omit these positional parameters is that PowerShell can deduce what to compare from the sequence.
Note 2: If your script fails, then check a) The names of the two files, b) They are in the folder referenced by your script.
Challenge 1: You could add the -includeEqual parameter and thus display all the items that you bought that were on the original list.
=> Means the InputObject is present in the difference (second) file, but not in the first file. In this scenario it means we bought stuff, which was not on the original list.
<= Present in reference (first) file, but not in the second file. In my analogy, we forgot to buy this item on our shopping list.
== Present in both files. Try my challenge and add the -includeEqual parameter, then you will see this double-equals underneath 'SideIndicator' in the output.
Windiff is a handy utility for comparing files and highlighting differences. My 'killer' use for Windiff is discovering where menu settings correspond to registry values. Another job for Windiff is checking directories and reporting and differences in the file lists.
If you like this page then please share it with your friends
See more Windows tools