Need to compare similar files for changes? Here’s how to do it in Windows 10 without third-party tools.

In Windows 10, “fc” (file compare) is a command line tool built into the system, which allows you to compare two similar files to see how they have changed over time. Usually, this utility will be useful for comparing simple text files, determining changes to a script, detecting if a file has been modified, and other similar scenarios.

The tool can compare two similar files or the most recent version against all other files in the same location. And it includes options to review changes at the text level, or in Unicode, ASCII, or binary mode.

dos-command

In this article, we’ll see how to use the fc tool to compare files from Command Prompt.

How to compare files with fc command on Windows 10?

To compare files with the fc command tool, follow these steps:

  • Open the start menu.
  • Search Command Prompt, right-click on the top result, and select the option Execute as administrator.
  • Enter the following command to navigate to the folder containing the files you want to compare and press Entrance :
cd PATHTOFILES
  • In the command, update the path PATH TO FILES with the location of the folder containing the files to compare.
  • In this example, you navigate to a folder on VS: called Downloads :
cd C:Downloads
  • Type the following command to compare two similar files and press Entrance :
fc nomfichier1.txt nomfichier2.txt
  • In the command, replace filename1.txt and filename2.txt by the name of the files you want to compare.
  • Type the following command to compare two similar files in ASCII mode and press Entrance :
fc /L nomfichier1.txt nomfichier2.txt
  • Type the following command to compare two files showing only the first row which is different and press Entrance :
fc /a nomfichier1.txt nomfichier2.txt
  • Type the following command to compare two files in Unicode mode and press Entrance :
fc /u nomfichier1.txt nomfichier2.txt
  • Type the following command to compare two files in binary mode and press Entrance :
fc /b nomfichier1.txt nomfichier2.txt
  • Type the following command to compare all files (* .txt) in the same folder with the new file (filename2.txt) and press Entrance :
fc *.txt nomfichier2.txt
  • Type the following command to compare two files located in different locations and press Entrance :
fc DRIVE:PATHTOfilename1.txt DRIVE:PATHTOfilename2.txt
  • In the command, replace DRIVE by the drive letter of the storage location and PATH TO filename1.txt and PATH TO filename2.txt with the path and name of the files you want to compare.
  • This example compares two files located in different folders:
fc C:UsersUSERACCOUNTDownloadsfilename1.txt C:UsersUSERACCOUNTDownloadsnewfilename2.txt
  • Analyze the result to see the difference between the files.
See also  How to check which app is using the most RAM in Windows 11?

Trick : You can display the list of options and other examples using the command fc /?.

Using the fc tool, you will be able to see the difference between two similar files.

Although the tool allows you to compare files, keep in mind that it is a basic tool intended for use with text files and extensions such as .exe, .com, .sys, .obj, .lib or .bin. You may be able to compare files like Microsoft Office ones or pictures, but you will only be able to compare them at the binary level.

About the author

admin

Leave a Comment