Compare 2 Folder Contents through Command Prompt in Windows 10

Did you know that the Windows 10 Command Prompt can compare the contents of two folders? If not, see how.


If you have to compare the contents of two folders in windows 10 you will find that there is no Microsoft application that does your job and you should turn to third party applications. There may be no applications, but there are Command Prompt commands.

The Command Prompt or in Greek "Command Prompt”Is accompanied by a built-in tool that called RoboCopy. It is a very useful tool that can, among other things, compare the contents of two folders. All you need to know is the correct syntax to run.

To compare the contents of two folders, you need the full path to both folders you want to compare. It is quite easy to learn them. Open the two folders from "File Explorer" and click inside the location bar. Copy the folder locations and paste them into the following command. Replace Path1 and Path2 with the paths to the two folders you want to compare.

robocopy Path1 Path2 /L /NJH /NJS /NP /NS

robocopy "C:\iguru\dimitris\222 data1" "C:\iguru\dimitris\3 data" /L /NJH /NJS /NP /NS

Understanding the results:
For the above command, the Command Prompt returned the following results. When you run this command on your system, the file names will be different. However, the title * EXTRA File and the title New File will precede the files found by RoboCopy. You need to understand the result in order to find the differences between the two folders you just compared.

* EXTRA File Sample10.jpg
* EXTRA File Sample11.jpg
* EXTRA File Sample18.jpg
* EXTRA File Sample19.jpg
* EXTRA File Sample20.jpg
New File Sample04.jpg
New File Sample05.jpg
New File Sample06.jpg
New File Sample07.jpg
New File Sample08.jpg
New File Sample09.jpg
New File Sample12.jpg
New File Sample13.jpg
New File Sample14.jpg

RoboCopy shows you the unique files in the two comparable folders. This means that all the files listed in the results only appear in one of the two folders you compared.

The files in front of * EXTRA File are the files in the second folder that you entered in the command. From the previous example, the files Sample10.jpg, Sample11.jpg, Sample18.jpg, Sample19.jpg, Sample20.jpg, are the files of the second folder (C: \ iguru \ dimitris \ 3 data) WHICH do NOT exist in the first folder (C: \ iguru \ dimitris \ 222 data1).

Obviously, the filenames in front of New File are all files in the first folder that you enter in the robocopy command that do not exist in the second folder.

The command will not list the files that are common between the two folders.

If you have trouble finding the results, run the command in two virtual folders that have only a small number of files, so that you can compare the results with the actual files in your folders and understand them.

Read them Technology News from all over the world, with the validity of

Follow us on Google News at Google news