---
title: "How to Use WinDiff to Compare Files"
description: "Learn how to compare files using the good ol’ Windows windiff utility in this step-by-step tutorial."
canonical: "https://adamtheautomator.com/windiff/"
---

# How to Use WinDiff to Compare Files

> Learn how to compare files using the good ol’ Windows windiff utility in this step-by-step tutorial.

Source: https://adamtheautomator.com/windiff/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Use WinDiff to Compare Files](https://adamtheautomator.com/wp-content/uploads/2021/07/How-to-Use-WinDiff-to-Compare-Files.jpg)

# How to Use WinDiff to Compare Files

[![](https://secure.gravatar.com/avatar/f08b754bc0dce1c76685f6afa93185ecfb6f861fd14f993286e06bba69eaeb8b?s=192&d=mm&r=g)Adam Listek](https://adamtheautomator.com/author/alistek/)21 July 20216 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[File Management](/tag/file-management/)

Table of Contents

*   [Prerequisites](#h-prerequisites)
*   [Installing WinDiff from the Microsoft SDK](#h-installing-windiff-from-the-microsoft-sdk)
*   [Comparing a File in the WinDiff Application](#h-comparing-a-file-in-the-windiff-application)
*   [Modifying Compared Files](#h-modifying-compared-files)
*   [Commenting on a Change](#h-commenting-on-a-change)
*   [Comparing Folders in WinDiff](#h-comparing-folders-in-windiff)
*   [Marking Files via RegEx](#h-marking-files-via-regex)
*   [Customizing WinDiff](#h-customizing-windiff)
*   [Modifying the WinDiff File Editor](#h-modifying-the-windiff-file-editor)
*   [Changing Default Tab Comparison Size](#h-changing-default-tab-comparison-size)
*   [Exporting a Text File of Differences or Comments](#h-exporting-a-text-file-of-differences-or-comments)
*   [Conclusion](#h-conclusion)

Need to compare files or source code? Does eyeballing the files can seem like searching for a needle in a haystack? Despite its age, the [Microsoft WinDiff](https://docs.microsoft.com/en-US/troubleshoot/windows-client/shell-experience/how-to-use-windiff-utility) utility still works well for file and directory comparisons. The application offers enough functionality to make short work of any file comparison needs.

In this article, you will discover how to use the WinDiff utility to compare both files and folders. Learn how to ignore marked files for comparison, export results to a text file, and edit resulting comparisons.

## Prerequisites

As the WinDiff utility is not included within Windows you must first download or install the utility for use. For this, you simply need a modern version of Windows. This article uses Windows 10.

## Installing WinDiff from the Microsoft SDK

To get started with WinDiff, you must first download it since it’s not included, by default, in Windows. You can find WinDiff via an older download of the Microsoft SDK for Windows 7 and .NET Framework 4.

> _There are two unofficial mirrors that offer just the `windiff.exe` executable without needing to download and install the entire SDK. Both [Grig Software](https://web.archive.org/web/20060215224549/http://www.computerperformance.co.uk/ScriptsGuy/windiff.zip) and [Archive.org](https://web.archive.org/web/20060215224549/http://www.computerperformance.co.uk/ScriptsGuy/windiff.zip) offer versions for download._

1\. First, open your favorite web browser and navigate to the [Microsoft Windows SDK for Windows 7 and .NET Framework 4](https://www.microsoft.com/en-us/download/details.aspx?id=8279) download page and click the **Download** button.

2\. Once downloaded, launch the `winsdk_web.exe` executable. You may see the following warning on Windows 10, which you can click **OK** to bypass without issue.

![Clicking through warning message.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T154515.282.png)

Clicking through warning message.

3\. Click through all of the defaults until you get to the **Installation Options** screen.

4\. Since the Windows SDK has a lot more than just WinDiff, uncheck all entries except for **Tools** under the Windows Native Code Development section.

![Selecting only Tools under the Windows Native Code Development section.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T154557.038.png)

Selecting only Tools under the Windows Native Code Development section.

5\. Click **Next** to begin the installation and **Finish** to complete it.

## Comparing a File in the WinDiff Application

Now that you have downloaded or installed the WinDiff application, it is time to learn how to navigate and use this useful utility. Although WinDiff may have a sparse interface, there is more than meets the eye.

1\. Launch WinDiff from either _C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Bin\\windiff.exe,_ if acquired from the Windows SDK, or from the download location of the unofficial mirror.

![WinDiff opening screen.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T154654.663.png)

WinDiff opening screen.

2\. Click on the **File** menu and choose **Compare Files**.

![Opening files to compare.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T154740.512.png)

Opening files to compare.

3\. Choose the first file for comparison, often these are source code files, but here text is used.

![Choosing the first file to compare.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T154819.717.png)

Choosing the first file to compare.

4\. Then choose the second file to compare to.

![Choosing the second file to compare ](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T154851.037.png)

Choosing the second file to compare

Once the files have been loaded, you will be presented with an overview showing the files for comparison.

5\. Double-click the entry to compare, or click the **Expand** button. You’ll then be presented with a screen that breaks down the differences and similarities in the compared files.

![Overview of files chosen for comparison. ](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T154935.780.png)

Overview of files chosen for comparison.

![Demonstrating changed lines within files.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155011.140.png)

Demonstrating changed lines within files.

On the left-hand side, you will find a mini-map view that highlights the overall differences throughout the files to quickly navigate right to a section of the file.

On the right-hand side, you will find the differences on different color highlighted lines. The color yellow is used to highlight differences in the first file and the color red for the second file.

## Modifying Compared Files

Now that you have compared the two files to spot differences, you may need to reconcile the differences between the two files. To do this, you can either edit the first file, the second file, or a composite between the two files. Although WinDiff is not a merge tool, read on to learn how to edit files with changes!

1\. First, right-click on the line that you would like to modify. Note that the same lines between the files will have the same line number, as seen below.

![Modifying lines in a compared file.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155102.976.png)

Modifying lines in a compared file.

2\. In this example, to modify a highlighted change, choose to edit the **Left File** first, which will by default launch in Notepad. Below, the file has been modified to have an identical second line.

![Modifying a file compared in WinDiff.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155135.901.png)

Modifying a file compared in WinDiff.

3\. Back in the WinDiff utility, right-click on the first modified line and choose **Rescan** to update the scanned files to look for any changes.

![Rescanning for changes in WinDiff. ](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155226.518.png)

Rescanning for changes in WinDiff.

As you can see below, the comparison no longer shows the modified line.

![Demonstrating the newly changed files.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155257.127.png)

Demonstrating the newly changed files.

## Commenting on a Change

One useful ability within WinDiff is the ability to make a comment on a change. This comment can later be exported to a text file. If you close WinDiff without exporting the comment, it will be lost when WinDiff is closed.

1\. First, click on the change to comment on and navigate to the **Edit** menu and click **Insert Comment**.

![Adding a comment to a changed line.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155337.030.png)

Adding a comment to a changed line.

2\. Enter your comment text and click **OK**.

![Inserting a comment.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155418.906.png)

Inserting a comment.

3\. You will see a new comment shown in green, in-between the changed lines.

![Demonstrating the inserted comment.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155521.722.png)

Demonstrating the inserted comment.

## Comparing Folders in WinDiff

Now that you have compared files in WinDiff, you may find you need to compare an entire folder. Just like files, WinDiff offers the ability to compare two different folders. Follow the steps below to compare two different directories.

Related:[How to Compare Directories with PowerShell](https://adamtheautomator.com/powershell-compare-directories/)

1\. Open WinDiff and choose **File → Compare Directories**. Enter the location of the two directories to compare. Optionally, you may choose to include sub-directories as well.

![Opening the compare directories dialog.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155623.816.png)

Opening the compare directories dialog.

2\. Once presented with the list of changes, double-click on the file to expand and further compare.

![Showing the changed and identical files within WinDiff.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155658.592.png)

Showing the changed and identical files within WinDiff.

3\. Since you see that _file1.txt_ is identical, perhaps you want to ignore this file. WinDiff offers you the ability to Mark a file and hide it from view. Right-click on the file to hide and choose **Mark**.

![Marking a file.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155734.383.png)

Marking a file.

4\. Once marked, the line will turn yellow. Click the **Mark** menu and choose **Hide Marked Files**.

![Hiding marked files.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155810.670.png)

Hiding marked files.

5\. This will leave only those files left that you choose to focus on, as seen below.

![Showing the result of hiding marked files.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155846.697.png)

Showing the result of hiding marked files.

### Marking Files via RegEx

If you have a number of files that you would like to ignore, but individually marking them would be time-consuming, then you may specify a regular expression instead.

1\. First, click on the **Mark** menu and then on **Mark Pattern** as seen below.

![Marking a pattern of files.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T155933.270.png)

Marking a pattern of files.

2\. Enter in a regular expression to filter out the `.ps1` files. The example below uses, `[ps1]$` as the regular expression.

![Entering in a regular expression.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160007.041.png)

Entering in a regular expression.

3\. Finally, choose **Hide Marked Files** from the **Mark** menu.

![Hiding marked files.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160037.724.png)

Hiding marked files.

## Customizing WinDiff

Although the defaults in WinDiff work perfectly well, there are times you may want to modify WinDiff to better fit your workflow. Read on to learn what can be customized!

### Modifying the WinDiff File Editor

Throughout this article, you have used Notepad for your file editing. A modern editing application to compare files is [Visual Studio Code](https://code.visualstudio.com/). How then, would you tell WinDiff to launch edits in this utility instead?

1\. First, click on the **Edit** menu and choose **Set Editor**.

![Setting the editor in WinDiff.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160121.271.png)

Setting the editor in WinDiff.

2\. Enter `"C:\Users\user\AppData\Local\Programs\Microsoft VS Code\Code.exe" %p` into the set editor prompt and click **OK**.

> _Make sure to replace “user” above with your username, if you are using a per-user install of Visual Studio Code. If VS Code is installed for all users, then use that location instead._

![Entering in the editor command to run.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160232.432.png)

Entering in the editor command to run.

3\. Finally, right-click on a line with highlighted differences and choose the option to edit the composite file and launch the file in the Visual Studio Code editor.

![Demonstrating opening a combined file in Visual Studio Code.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160309.681.png)

Demonstrating opening a combined file in Visual Studio Code.

> _WinDiff does not appear to be properly sending an individual file, left or right, to an external editor other than notepad. Your mileage may vary here, but composite files do work._

### Changing Default Tab Comparison Size

The default tab size used in WinDiff is set to the equivalent of 8 spaces, rather than the more typical 2 or 4. With this larger size, the comparisons of the files may not be correct. Therefore, you will want to modify this value and set it accordingly.

To do so click on the **Editor** menu and **Set Tab Width**. Next, set the tab width to the correct value and click **OK**.

![Setting tab width in WinDiff.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160414.382.png)

Setting tab width in WinDiff.

![Setting tab width in WinDiff.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160355.373.png)

Setting tab width in WinDiff.

### Exporting a Text File of Differences or Comments

Finally, you have the ability to export either a file list of differences or a list of the comments in a file. To export the file list, click the **File** menu and choose **Save File List**. Enter the location to save, relative to the current compared files, and choose the options to modify. Finally, click **OK** to export the file list.

![Exporting file list of compared files.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160516.963.png)

Exporting file list of compared files.

![Save file list dialog box.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160539.863.png)

Save file list dialog box.

To export the list of comments in a file, once again, click on the **File** menu and choose **Save Comments List**. Enter the location to save the comments list and click **OK**.

![Exporting comments from a compared file.](https://adamtheautomator.com/wp-content/uploads/2021/07/Untitled-2021-07-19T160602.493.png)

Exporting comments from a compared file.

## Conclusion

Now that you have learned how to use WinDiff to compare files and folders, this small utility becomes quite useful for fast file and folder comparisons. Of course, you may find that this utility does not fit all your needs, and there are several alternatives available such as [WinMerge](https://winmerge.org/?lang=en).

Nonetheless, the older WinDiff utility still finds a home in many an IT professionals toolbelt, see how you can use WinDiff to compare your data today!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fwindiff%2F&text=How%20to%20Use%20WinDiff%20to%20Compare%20Files)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fwindiff%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fwindiff%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2022/11/How-to-Install-NitroShare-for-Cross-Platform-File-Transfer.jpg)

### [Install NitroShare and Streamline Your File Transfers Today](/nitroshare/)

Simplify cross-platform file transfers with NitroShare. This tutorial guides you through installation and use for fast, effortless file sharing between different operating systems.

![](https://adamtheautomator.com/wp-content/uploads/2021/06/winSCP-command-line.jpg)

### [WinSCP Command-Line Simplified : Your Complete Reference](/winscp-command-line/)

Explore the depths of WinSCP Command-Line in our guide. Master file transfer and automation with expert tips, techniques, and practical examples for users at all levels.

![](https://adamtheautomator.com/wp-content/uploads/2023/03/seafile.jpg)

### [Get Started With Seafile Self-Hosted Cloud Storage](/seafile/)

Get started with your own cloud storage solution. Seafile offers a self-hosted alternative with easy setup, secure file sharing, and data privacy.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
