Windows diff directories files

Here is a complete guide showing different methods to compare two folders on your Windows 11/10 PC. If you have two or more identical folders and want to find out the differences between the two, this post will help you find out the differences as well as similarities between the folders. You can even compare three folders using some methods.

Here are the different methods using which you can compare two folders on your Windows 11/10 PC:

  1. Compare two folders using Properties.
  2. Use Command Prompt to compare two folders.
  3. Compare two folders using PowerShell.
  4. Use a third-party app to compare folders.

1] Compare two folders using Properties

compare two folders

The easiest way to compare two folders on Windows is to use the Properties dialog window. Windows allow you to check various properties of files and folders using the right-click menu. If you want to compare basic information of two or more folders like size, number of files, number of folders, location, creation date, etc., you can open and compare their Properties windows. Let us check out how.

First, go to the location where the first folder is saved and right-click on it. Next, select the Properties option from the appeared context menu.

Now, please move to the second folder, right-click on it, and choose the Properties option.

After that, keep the two Properties windows side by side and compare several statistics of both folders.

Read: Compare two Text files with Text Comparator software.

2] Use Command Prompt to compare two folders

The first method shows the basic differences between the two folders. However, if you want to know what exactly is different in two folders, it won’t work. So, in that case, you can use Command Prompt to find out the differences between folders.

You can compare two folders using Command Prompt or Windows PowerShell by entering the required commands. You can run Windows built-in tool called Robocopy in Command Prompt to easily find out the differences between two folders.

Note: This method will only show the difference between the two main folders and not the sub-folders.

Now, let us check out the steps to compare two folders using Command Prompt:

First, open the Notepad application and type the paths of the two folders that you want to compare.

For that, go to the folder, right-click on it, click on the Copy as path option, and paste the copied path into Notepad.

Now, Command Prompt app as an administrator; click on the taskbar search button, type cmd in the search box, hover the mouse over the Command Prompt app from the results, and click on Run as administrator.

Next, type the below command in CMD:

robocopy

After that, press Spacebar and type the path to the first folder that you copied in Notepad previously. And then, press Spacebar and type the path of the second folder.

For example:

robocopy "D:\TWC" "D:\Writing"

Now, complete the command with /L /NJH /NJS /NP /NS to see the differences between the two folders. Your final command will look something like the below command:

robocopy "D:\TWC" "D:\Writing" /L /NJH /NJS /NP /NS

Once you entered the above command, it will show you the differences between the two folders.

  • *EXTRA File: Files present in the second folder, not the first folder.
  • New File: Files present in the first folder, not the second one.
  • Older: Files are present in both folders, but the creation date of the file in the first folder is older than the same file in the second folder.
  • Newer: Files are present in both folders, but the creation date of the file in the first folder is later than the same file in the second folder.

Based on the above parameters, you can analyze the difference between the two folders.

See: How to compare two Word documents and highlight differences?

3] Compare two folders using PowerShell

How to compare two Folders in Windows

Another method to compare two folders on Windows is using Windows PowerShell. You need to enter a specific command in PowerShell and it will display differences between two folders. Let us check out what that command is.

First, open the Windows PowerShell app using the Windows Search option.

Now, type and enter the below command followed by the path of the first folder:

$fso = Get-ChildItem -Recurse -path "D:\TWC"

In the above command, replace “D:\TWC” with the path of the first folder that you want to compare.

Next, enter another command followed by the second folder that you want to compare. It will look like the command below one:

$fsoBU = Get-ChildItem -Recurse -path "D:\Writing"

Replace “D:\Writing” with your second folder’s path in the above command.

After that, type the below command to show the differences between the pre-specified two folders and press Enter:

Compare-Object -ReferenceObject $fso -DifferenceObject $fsoBU

It will now show you the differences between the two folders, like files present in the first folder but not in the second one, and vice-versa.

The => SideIndicator shows the files appearing in the second folder, not in the first folder. On the other hand, <= SideIndicator shows the files appearing in the first folder only.

Read: Compare and Synchronize files and folders with FreeFileSync.

4] Use a third-party app to compare folders

You can also use third-party software to compare two folders on Windows. There are various dedicated software that are entirely dedicated to comparing two folders. Here are some good ones that you can use for free:

  • WinMerge
  • Compare Advance
  • Meld
  • MOBZync

A] WinMerge

WinMerge is a popular free and open-source differencing and merging software that compares two folders. It also lets you merge the differences between two folders and make them identical. Besides folders, it can also be used for comparing files and documents.

Using this software, you can compare three folders with each other. It also provides various options to customize the folder view, such as Show Identical Items, Show Different Items, Show Binary Files, 3-way Compare, etc. It also lets you view and compare folder statistics like the number of subfolders and the number of files.

You can also generate a comparison report in CSV, HTML, XML, or Text format. For that, click on the Tools menu and select the Generate Report option.

Let us now check out the steps to compare folders in this software.

First, you need to download and install WinMerge from its official website, and then open the main GUI of this software.

Next, click on the Open button from its toolbar.

After that, browse and select the first folder, second folder, and third folder (optional) that you want to compare.

At last, press the Compare button and it will display the differences between the folders, You can see the files present in the first folder only, the files present in the second folder only, the creation date, etc.

In case you want to merge the differences, you can use the Merge menu options to do so.

Read: How to compare the same files in the same folder in different locations?

B] Compare Advance

Another free software that you can use to compare two folders is Compare Advance. Not just finds differences between two folders, but it also lets you synchronize files and folders between two computers. Let us see how you can use this software.

First, launch the software and enter the path of the first folder under the Folder 1 section in the left-side pane. Next, browse and select the second folder under the Folder 2 section. Once done, press the Compare button and it will show you the differences between the two selected folders in the right-side panel.

It shows the differences in different tabs including the following:

  • Folder 1 only: Files and folders present in the first folder only.
  • Folder 2 only: Files and folders present in the second folder only.
  • Same: Same files between the two folders.
  • Different: Files that are different.

The basic folder statistics are also shown in the left-side pane under the Statistics section. You can also use the Sync feature to synchronize the content between the two folders that you compared.

If you like it, you can download it from here.

See: Best free file and folder synchronization software for Windows.

C] Meld

Meld is the next free software to compare two folders on Windows visually. It offers two and a three-way comparison feature to compare up to three files or folders.

Download and install this software, and open it. Now, select the Folder button from its home screen and then choose the first and second folders that you want to compare. If you want to compare three folders, tick the 3-way comparison checkbox and then select the third folder.

Once done, click on the Compare button and it will start scanning the two or three folders for differences and similarities.

All in all, it is a nice and easy-to-use folder compare software.

Read: How to compare two Identical Images in Windows?

D] MOBZync

You can also try MOBZync which is a great folder compare software for Windows 11/10. It is free software that lets you compare two folders on your PC.

As you open this software, you will see its interface divided into two sections. You can add the first folder in the left section and provide the second folder in the right section. It will show you the content of both folders in the respective sections.

To view the comparison between the folders, press the Compare button from its toolbar and it will show you differences like Unchanged files, Newer files, Added files, and Older files.

MOBZync also provides a dedicated Synchronize function using which you can synchronize files between the two folders. You can also copy files from left to right and vice versa.

You can get it from here.

Read: How to Merge Folders in Windows?

Can Notepad ++ compare folders?

No, Notepad++ doesn’t have an inbuilt feature to compare files or folders. However, there is still a way to compare two files in Notepad++ using a plugin. You can open its Plugins Admin page and install the Compare plugin. Once the plugin is installed, you will be able to open two files and compare them. Although, it won’t let you compare two folders.

Quick Links

  • Compare Folders From Properties

  • Compare Folders Using Command Prompt

  • Compare Folders With WinMerge

Summary

  • One way to compare folders is to right-click your folders one at a time and choose «Properties» for each. Then compare the Properties window of each folder.
  • The robocopy command is a command-line tool that can be used to view the differences between folder.
  • Use WinMerge to compare the contents and details of folders if you want a graphical tool.

Do you want to compare the number of files or folders or simply visualize the difference between two folders? If so, you have two graphical and one command line method to do that. We’ll show you how to perform the folder comparison task on your Windows 11 or Windows 10 PC.

Compare Folders From Properties

To compare the number of files, subfolders, the size, and the creation date of two folders, use the Properties option in Windows File Explorer. This lets you quickly glance at the main attributes of a folder.

To start, launch File Explorer using Windows+E. Find the first folder, right-click it, and select «Properties.»

'Properties' highlighted for a folder in File Explorer.

Keep the first folder’s «Properties» window open. Then, find the second folder, right-click it, and select «Properties.»

You now have the «Properties» window open for both your folders. Bring these windows side-by-side by dragging them, and you can see the differences in the contents of these folders. For example, you can see how many files both folders have, what size these folders are, and so on.

'Properties' windows for two folders in File Explorer.

That gives you a general overview of the differences between your folders.

Compare Folders Using Command Prompt

If you prefer command line methods over graphical ones, use the robocopy command in Command Prompt to see the differences between the two folders. This command is actually for copying files from one folder to another, but you can make it show the differences between two specified folders and not copy any files.

To use robocopy, first open the Start Menu, search Command Prompt, and launch it.

Command Prompt highlighted in Start Menu.

In Command Prompt, type the following command. Replace «Folder1» with the path to your first folder and «Folder2» with the path to your second folder. Ensure both folder paths are enclosed in double quotes.

To copy a folder’s full path along with double quotes around the path, hold down the Shift key on your keyboard, right-click your folder, and choose «Copy as Path.»

robocopy "Folder1" "Folder2" /L /NJH /NJS /NP /NS
The 'robocopy' command typed in Command Prompt.

You’ll see the differences between your folders.

If you’re curious as to what the robocopy command does, here’s an explanation of each flag we used with the command:

  • L: This tells the command not to copy files but show the log of the files in the specified folder.
  • NJH: This flag excludes junctions, hard links, and reparse points from consideration. This way, the command focuses on the regular files in the specified folders.
  • NJS: This flag excludes symbolic links from the process.
  • NP: This flag excludes folder timestamps.
  • NS: This flag excludes file security information.

Compare Folders With WinMerge

If you want more details about the differences in your folders, Windows doesn’t have a built-in tool to help you with that. However, you can use a free third-party app called WinMerge to compare multiple folders.

To use it, launch a web browser on your PC, head to the WinMerge site, and download and install the app. Make sure to download the app’s executable and not the ZIP version.

Open the WinMerge app, then select File > Open in the Menu Bar or press Ctrl+O.

File > Open highlighted in WinMerge.» src=»https://static1.howtogeekimages.com/wordpress/wp-content/uploads/2024/01/5-open-folder-winmerge.jpg»></p>
<div class= Картинка с сайта: www.howtogeek.com

For the «1st File or Folder» field, select «Browse» and choose the first folder to compare.

'Browse' highlighted for the '1st File or Folder' field in WinMerge.

For the «2nd File or Folder» field, click the «Browse» button and choose the second folder to compare.

'Browse' highlighted for the '2nd File or Folder' field in WinMerge.

In both fields, enable the «Read-Only» option. Click the «Folder: Filter» field and type *.* if it isn’t already there. This ensures the app compares all the files in both the specified folders. Then, at the bottom, click «Compare.»

Various comparison options highlighted in WinMerge.

On the following screen, you’ll see the comparison of the specified folders. You’ll see information like identical files in both folders, files missing from one folder, and so on.

The comparison of two folders in WinMerge.

And that’s how you know what one folder has that another doesn’t. This can be really useful if you’re trying to quickly compare different versions of the same folder, like you’d have when you create a backup.

Two folders side by side in Windows

Comparing two folders without actually going through their contents can be handy at times. Let’s look at some methods to accomplish this in Windows.

Of course, you can always manually open every directory to check the files, but that gets unwieldy — especially if you are sifting through dozens or even hundreds of folders with similar files (backups, for example). For such scenarios, you need a better approach.

Using the Properties Window

A simple way to get a quick glance at the details of any folder is by looking at the Properties. While this saves you from having to open the folder and peruse the contents, you still have to individually right-click every directory you want to check the properties of.

This makes it unsuitable for large-scale comparisons, but for most home users, that is not an issue. If all you want is to look at the size of each folder and how many files it contains, the Properties window is enough.

  1. To open the Properties window of a folder, right-click on it and select Properties from the menu.
How to Compare Two Folders or Directories in Windows image 2

  1. This opens a small window displaying all details of the folder, including its size, the number of other files or folders contained in it, as well as the time and date of creation.
  1. To compare with another folder, simply drag this window to a side and repeat the process with the second directory.
How to Compare Two Folders or Directories in Windows image 4

  1. This way, you will have the two properties windows open side by side to compare directly. If your screen size permits, you can extend this even further and keep opening the Properties of other folders as well.

With WinMerge

There are other ways besides the Properties window to compare files and folders in Windows, but we are jumping straight to a third-party tool first. Why? Because it is much easier.

Let’s face it – no one fancies having to use the Command Prompt or type a PowerShell script for any task. While these methods have their uses (especially in system administration), most end users will find it easier to use a dedicated file comparison tool.

And that’s where WinMerge comes in. There are a bunch of such applications, of course, but WinMerge is by far the most popular. It is a free tool, so it costs you nothing to download and use if you find yourself comparing folders.

Don’t be confused by its name – while its primary use is to merge folders, it can

  1. To start comparing folders using WinMerge, download the software from its official website. Multiple installers are available, though going with the top one is usually the best option.
How to Compare Two Folders or Directories in Windows image 5

  1. Run the downloaded setup to install WinMerge on your computer.
How to Compare Two Folders or Directories in Windows image 6

  1. Launching WinMerge opens a blank window as no folders have been selected yet.
How to Compare Two Folders or Directories in Windows image 7

  1. Open a folder by selecting File > Open or clicking on the dedicated icon on the toolbar. You can also hit the Ctrl + O on your keyboard.
How to Compare Two Folders or Directories in Windows image 8

  1. Up to three folders can be opened simultaneously, allowing you to compare them. Click on the Browse button under each of the entries to select the folders to be compared. At least two are needed for comparison – the third is optional.
How to Compare Two Folders or Directories in Windows image 9

  1. One problem you may run into when using this method is that the window keeps opening the folders you want to select. To get past this issue, right-click on the target folder and select the Copy as path option, pasting this into the text bar.
How to Compare Two Folders or Directories in Windows image 10

  1. Hit enter when you are done. WinMerge will now go through the folders you specified, comparing their files and collecting all relevant information.
How to Compare Two Folders or Directories in Windows image 11

  1. When this scan is complete, the files will be listed in an easy-to-parse format. Unique files are categorized as “Left” or “Right” depending on which folder they belong to. Identical files are highlighted in red with both the dates of creation listed at once.
How to Compare Two Folders or Directories in Windows image 12

Through the Command Prompt

Third-party tools aside, Windows has some utilities for file comparison as well. Unfortunately, they lack a GUI, since we are talking about CMD commands. But if the terminal screen does not daunt you, the robocopy command (and yes, that’s the actual name of the command) can be a powerful tool.

While the Properties window is good for comparing folders at a glance, it doesn’t really tell you much about their contents or how they differ. Which is a problem when you are comparing backup folders, as you need to quickly find out the unique files in them. The robocopy command is perfect for this.

  1. To compare folders using the terminal, open Command Prompt. Just type cmd in the Start menu and open the app.
How to Compare Two Folders or Directories in Windows image 13

  1. Now we can use the robocopy command to compare directories. Keep in mind that by default, the command is meant for copying files, so you need to add some flags for it to compare them instead.
  2. Begin by typing robocopy followed by the paths of the two folders you want to compare (you can right-click on the folders and select Copy as path to get their paths easily). Like this:
    robocopy “C:\Users\lloyd\Documents” “C:\Users\lloyd\Downloads”
How to Compare Two Folders or Directories in Windows image 14

  1. Next, we will append the following flags in the command
    /L /NJH /NJS /NP /NS
    The final command will look like this:
    robocopy “C:\Users\lloyd\Documents” “C:\Users\lloyd\Downloads” /L /NJH /NJS /NP /NS
How to Compare Two Folders or Directories in Windows image 15

  1. Once everything is in place, hit the enter key. The contents of the directories will be compared, giving you a summary of their differences. Unique files in the first folder are listed under New File while differing files in the second folder come under Extra File. When files are the same, they get sorted into Older or Newer based on their creation date in the first directory.
How to Compare Two Folders or Directories in Windows image 16

Using Powershell

Command Prompt isn’t the only command-based interface in Windows. Powershell is a more modern, more powerful scripting feature that can be used to automate most Windows tasks, and of course, compare folders.

Unlike Command Prompt, however, Powershell doesn’t quite have a dedicated command to compare folders. Instead, we need to chain together multiple commands to get the differences between two directories.

To pull it off, we will first recursively use the Get-ChildItem command on both the directories and store them in different variables. Then we can use the Compare-Object command to compare the data and list out the differences..

If this seems more involved than the Command Prompt, it is. The main advantage of Powershell is that it can be scaled up to hundreds or even thousands of folders easily.

  1. To start comparing folders with the powerful scripting utility, search for Powershell in the Start Menu and run it. This usually opens the PowerShell Integrated Scripting Environment, or PowerShell ISE as it is named in the menu.
How to Compare Two Folders or Directories in Windows image 17

  1. The PowerShell window will open with a blank script, starting at your user directory just like the Command Prompt.
How to Compare Two Folders or Directories in Windows image 18

  1. Use the Get-ChildItem command recursively on the first folder’s path and store the result in a variable. Like this:
    $folder1 = Get-ChildItem -Recurse -Path “C:\Users\lloyd\Documents”
How to Compare Two Folders or Directories in Windows image 19

  1. Repeat this for the second folder, using a different variable.
    $folder2 = Get-ChildItem -Recurse -Path “C:\Users\lloyd\Downloads”
How to Compare Two Folders or Directories in Windows image 20

  1. Now, use the Compare-Object command on the two variables, giving you the differences in their contents.
    Compare-Object -ReferenceObject $folder1 -DifferenceObject $folder2
How to Compare Two Folders or Directories in Windows image 21

What is the Best Method to Compare Two Folders in Windows?

Built-in methods of comparing directories are scarce in Windows, so the most convenient option is to use a third-party tool like WinMerge. Such a method is user-friendly and flexible, giving you the best experience in comparing multiple folders without getting overwhelming.

If you are only interested in a surface-level comparison, simply opening the Properties window of the folders side-by-side may be good enough. This is handy for determining the size of folders, or the number of files they contain.

But the most powerful method of comparing directories is invariably by using scripts or commands. For this, you can either leverage Powershell or the Command Prompt. The syntax is a bit weird in both cases, but you can always copy the command for subsequent uses, and copy the paths from the Properties tab too.

Related Posts

  • How to Fix a “This file does not have an app associated with it” Error on Windows
  • How to Add OneDrive to Windows File Explorer
  • How to Fix an Update Error 0x800705b4 on Windows
  • How to Resolve “A JavaScript error occured in the main process” Error on Windows
  • How to Fix the Network Discovery Is Turned Off Error on Windows

Backing up data and files is a norm in modern computing. When we backup our files and folders, we sometimes end up with two or more same folders that we are not sure which one is up to date. In such event, it is hard to decide which folder to keep and which to delete. If this happens, you can manually check the differences between two folders by comparing them using a third party tool or by using built-in commands via Command Prompt or PowerShell.

This guide will show you how to compare folders in Windows 11 using a powerful folder comparison tool called WinMerge, or using CMD, Windows Terminal or Windows PowerShell if you prefer not to install any third party software.

Related: How to Sync Files Between Two Folders or Computers in Windows 11/10

Compare folders in Windows 11 with WinMerge

WinMerge is an open source comparison and merging tool for Windows that let users compare files and folders and display the differences in a visual form that is easy to understand and manage. Below is a step-by-step guide on how to use WinMerge to compare two folders in Windows 11.

1. Download WinMerge from https://winmerge.org/downloads/. We recommend to download the portable version (ZIP format) so that you don’t have to install the software.

2. If you download the installer version, run the setup and follow the on-screen instruction to install the software. If you download the ZIP version (portable), unzip the folder to anywhere you like and run the WinMergeU.exe from the extracted folder.

Open WinMerge in Windows 11

3. In WinMerge window, press Ctrl + O or click File > Open. Under 1st File or Folder, click Browse and browse to the first folder you want to compare. Do the same for 2nd File or Folder.

WinMerge compare folders

Tip: When you browse, click Open when you are in the folder you want to compare. You don’t have to select any file in the folder. You can also manually enter the path to the folder instead of browsing it. Alternatively, you can add a third folder to compare.

Browse to folder WinMerge

Once at least two folders are selected, click Compare to compare them.

4. WinMerge will then show the comparison result in a new tab. It will tell you which files are different and which file are newly added, etc.

Compare folders in Windows 11

5. Other than just comparing the differences of the availability of files in the two folders, WinMerge also lets you view the actual differences of some supported file formats such as text files, and allows you to edit the files directly from the app.

How to compare two folders in Windows 11

To view the differences of a file, double-click the file in the comparison result tab. WinMerge will then open the selected files from the two folders and compare them in a new tab. From there you can view the differences between the two files and edit them as you wish.

Tip: How to Sort Folders by Size in Windows 11 / 10

Compare two folders using Command Prompt

If you prefer not to install anything, you can compare two folders using a built-in robocopy command tool via Command Prompt or the new Windows Terminal in Windows 11.

This method will tell you which file is different (newer or older) in the two folders, which file is newly added and which file is missing. It can’t show you detailed comparisons such as the actual differences of two different text files.

To compare folders using Command Prompt or Windows Terminal in Windows 11, follow the steps below. We will be using Windows Terminal instead in the guide below, but the same commands will work in Command Prompt as well.

1. Right-click on Start and select Windows Terminal (admin), or search for “command prompt” via Start and run it as administrator.

2. In Windows Terminal, enter the following command. Replace the paths to folders with the actual locations of the two folders on your computer that you want to compare.

robocopy "path to first folder" "path to second folder" /L /NJH /NJS /NP /NS

For example:

robocopy "C:\folder" "C:\folder 2" /L /NJH /NJS /NP /NS

Tip: If you have a complicated folder structure which makes it difficult to manually enter the folder paths in the terminal, you can right-click the folder and select Copy as path to copy the full path to the folder. You can then paste the folder path into the Windows Terminal by right-clicking in the terminal window.

Copy as path Windows 11

3. The terminal will then show you the differences of files in the two folders if there is any.

Compare two folders using Command Prompt

For example, if there is a file that exist in folder1 but not in folder2, it will show *Extra File or New File next to the name of the file. If two files of the same name is different from each other, it will show either Older or Newer next to the name of the file.

Compare two folders using Windows PowerShell

To compare two folders using a script in Windows PowerShell, follow the steps below. This method does not check the differences of files with the same name. It only compare the availability of files in the two folders.

Click Start, search for Windows PowerShell and run it as administrator.

Run PowerShell as Administrator Windows 11

In the elevated PowerShell window, enter the following commands in the order shown. Press Enter after each line of command. Replace the folder paths with the actual locations of the two folders on your computer that you want to compare.

$fso = Get-ChildItem -Recurse -path "C:\folder"
$fsoBU = Get-ChildItem -Recurse -path "C:folder 2"
Compare-Object -ReferenceObject $fso -DifferenceObject $fsoBU

Compare folders using PowerShell in Windows 11

PowerShell will then show the output of the comparison by listing the files that it finds to be missing from either folders.

Сравнение двух папок без фактического просмотра их содержимого иногда может оказаться полезным. Давайте рассмотрим некоторые способы сделать это в Windows.

Конечно, вы всегда можете вручную открыть каждый каталог, чтобы проверить файлы, но это становится громоздким, особенно если вы просматриваете десятки или даже сотни папок с похожими файлами (например, резервными копиями). Для таких сценариев вам нужен лучший подход.

Использование окна свойств

Простой способ быстро просмотреть подробную информацию о любой папке — просмотреть ее свойства. Хотя это избавляет вас от необходимости открывать папку и просматривать ее содержимое, вам все равно придется отдельно щелкать правой кнопкой мыши каждый каталог, свойства которого вы хотите проверить.

Это делает его непригодным для крупномасштабных сравнений, но для большинства домашних пользователей это не проблема. Если все, что вам нужно, — это посмотреть размер каждой папки и количество содержащихся в ней файлов, окна «Свойства» будет достаточно.

  1. Чтобы открыть окно свойств папки, щелкните ее правой кнопкой мыши и выберите в меню «Свойства».

Как сравнить две папки или каталоги в образе Windows 2

  1. Откроется небольшое окно, отображающее все сведения о папке, включая ее размер, количество других файлов или папок, содержащихся в ней, а также время и дату создания.
  1. Чтобы сравнить с другой папкой, просто перетащите это окно в сторону и повторите процесс со вторым каталогом.

Как сравнить две папки или каталоги в образе Windows 4

  1. Таким образом, два окна свойств будут открыты рядом для непосредственного сравнения. Если размер вашего экрана позволяет, вы можете расширить его еще больше и продолжать открывать свойства других папок.

С WinMerge

Помимо окна «Свойства» существуют и другие способы сравнения файлов и папок в Windows, но сначала мы перейдем сразу к стороннему инструменту. Почему? Потому что это намного проще.

Посмотрим правде в глаза: никому не хочется использовать командную строку или вводить сценарий PowerShell для выполнения какой-либо задачи. Хотя эти методы имеют свое применение (особенно в системном администрировании), большинству конечных пользователей будет проще использовать специальный инструмент сравнения файлов.

И тут на помощь приходит WinMerge. Таких приложений, конечно, масса, но WinMerge, безусловно, самое популярное. Это бесплатный инструмент, поэтому вам ничего не стоит загрузить и использовать, если вы сравниваете папки.

Пусть вас не смущает его название: хотя его основное предназначение — объединение папок, оно может

  1. Чтобы начать сравнивать папки с помощью WinMerge, скачайте программу с ее официального сайта. Доступно несколько установщиков, но лучшим вариантом обычно является использование верхнего.

Как сравнить две папки или каталоги в образе Windows 5

  1. Запустите загруженную программу установки, чтобы установить WinMerge на свой компьютер.

Как сравнить две папки или каталоги в образе Windows 6

  1. При запуске WinMerge открывается пустое окно, поскольку папки еще не выбраны.

Как сравнить две папки или каталоги в образе Windows 7

  1. Откройте папку, выбрав «Файл» > «Открыть» или щелкнув соответствующий значок на панели инструментов. Вы также можете нажать Ctrl+O на клавиатуре.

Как сравнить две папки или каталоги в образе Windows 8

  1. Одновременно можно открыть до трех папок, что позволяет сравнивать их. Нажмите кнопку «Обзор» под каждой записью, чтобы выбрать папки для сравнения. Для сравнения необходимы как минимум два — третий не является обязательным.

Как сравнить две папки или каталоги в образе Windows 9

  1. Одна из проблем, с которой вы можете столкнуться при использовании этого метода, заключается в том, что окно продолжает открывать папки, которые вы хотите выбрать. Чтобы обойти эту проблему, щелкните правой кнопкой мыши целевую папку и выберите параметр «Копировать как путь», вставив его в текстовую панель.

Как сравнить две папки или каталоги в образе Windows 10

  1. Нажмите Enter, когда закончите. WinMerge теперь просмотрит указанные вами папки, сравнивая их файлы и собирая всю необходимую информацию.

Как сравнить две папки или каталоги в образе Windows 11

  1. По завершении сканирования файлы будут перечислены в удобном для анализа формате. Уникальные файлы классифицируются как «Левые» или «Правые» в зависимости от того, к какой папке они принадлежат. Идентичные файлы выделены красным цветом, при этом обе даты создания указаны сразу.

Как сравнить две папки или каталоги в образе Windows 12

Через командную строку

Помимо сторонних инструментов, в Windows также есть несколько утилит для сравнения файлов. К сожалению, у них отсутствует графический интерфейс, поскольку речь идет о командах CMD. Но если экран терминала вас не пугает, команда robocopy (и да, это настоящее название команды) может стать мощным инструментом.

Хотя окно «Свойства» удобно для быстрого сравнения папок, оно мало что говорит вам об их содержимом или о том, чем они отличаются. Это проблема при сравнении папок резервных копий, поскольку вам нужно быстро найти в них уникальные файлы. Команда robocopy идеально подходит для этого.

  1. Чтобы сравнить папки с помощью терминала, откройте командную строку. Просто введите cmd в меню «Пуск» и откройте приложение.

Как сравнить две папки или каталоги в образе Windows 13

  1. Теперь мы можем использовать команду robocopy для сравнения каталогов. Имейте в виду, что по умолчанию команда предназначена для копирования файлов, поэтому вам нужно добавить несколько флагов, чтобы она могла их сравнивать.
  2. Начните с ввода robocopy, а затем путей к двум папкам, которые вы хотите сравнить (вы можете щелкнуть правой кнопкой мыши по папкам и выбрать «Копировать как путь», чтобы легко получить их пути). Вот так:
    robocopy "C:\Users\lloyd\Documents" "C:\Users\lloyd\Downloads"

Как сравнить две папки или каталоги в образе Windows 14

  1. Далее мы добавим следующие флаги в команду
    /L /NJH /NJS /NP /NS
    Окончательная команда будет выглядеть так:
    robocopy "C:\Users\lloyd\Documents" "C:\Users\lloyd\Downloads" /L /NJH /NJS /NP /NS

Как сравнить две папки или каталоги в образе Windows 15

  1. Как только все будет на месте, нажмите клавишу ввода. Содержимое каталогов будет сравниваться, и вы получите сводную информацию об их различиях. Уникальные файлы в первой папке перечислены в разделе «Новый файл», а разные файлы во второй папке — в разделе «Дополнительный файл». Если файлы одинаковы, они сортируются по «Старым» или «Новым» в зависимости от даты их создания в первом каталоге.

Как сравнить две папки или каталоги в образе Windows 16

Использование Powershell

Командная строка — не единственный командный интерфейс в Windows. Powershell — это более современная и мощная функция сценариев, которую можно использовать для автоматизации большинства задач Windows и, конечно же, сравнения папок.

Однако, в отличие от командной строки, в Powershell нет специальной команды для сравнения папок. Вместо этого нам нужно объединить несколько команд, чтобы получить различия между двумя каталогами.

Чтобы реализовать это, мы сначала рекурсивно воспользуемся командой Get-ChildItem для обоих каталогов и сохраним их в разных переменных. Затем мы можем использовать команду Compare-Object, чтобы сравнить данные и составить список различий.

Если это кажется более сложным, чем командная строка, то это так. Основное преимущество Powershell заключается в том, что его можно легко масштабировать до сотен или даже тысяч папок.

  1. Чтобы начать сравнение папок с помощью мощной утилиты сценариев, найдите Powershell в меню «Пуск» и запустите ее. Обычно при этом открывается интегрированная среда сценариев PowerShell или PowerShell ISE, как она называется в меню.

Как сравнить две папки или каталоги в образе Windows 17

  1. Окно PowerShell откроется с пустым сценарием, начиная с вашего пользовательского каталога, как и командная строка.

Как сравнить две папки или каталоги в образе Windows 18

  1. Используйте команду Get-ChildItem рекурсивно для пути к первой папке и сохраните результат в переменной. Вот так:
    $folder1 = Get-ChildItem -Recurse -Path "C:\Users\lloyd\Documents"

Как сравнить две папки или каталоги в образе Windows 19

  1. Повторите это для второй папки, используя другую переменную.
    $folder2 = Get-ChildItem -Recurse -Path "C:\Users\lloyd\Downloads"

Как сравнить две папки или каталоги в образе Windows 20

  1. Теперь используйте команду «Сравнить-Объект» для двух переменных, чтобы увидеть различия в их содержимом.
    Compare-Object -ReferenceObject $folder1 -DifferenceObject $folder2

Как сравнить две папки или каталоги в образе Windows 21

В Windows мало встроенных методов сравнения каталогов, поэтому наиболее удобным вариантом является использование стороннего инструмента, такого как WinMerge. Такой метод удобен и гибок, он дает вам лучший опыт сравнения нескольких папок, не усложняя задачу.

Если вас интересует только поверхностное сравнение, может быть достаточно просто открыть окно свойств папок рядом. Это удобно для определения размера папок или количества содержащихся в них файлов.

Но самым эффективным методом сравнения каталогов всегда является использование сценариев или команд. Для этого вы можете использовать Powershell или командную строку. Синтаксис в обоих случаях немного странный, но вы всегда можете скопировать команду для последующего использования, а также скопировать пути со вкладки «Свойства».

Просмотров: 642

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Основные отличия операционных систем windows nt от windows 9x
  • Windows переместить окно клавиатурой
  • Java software для windows
  • Какой кнопки нет в операционной системе windows
  • Драйвера для sp flash tool windows 10