fc C:UsersUrviDesktopFile1.txt C:UsersUrviDesktopFile2.txt If the files are at different locations you can add the file path before the file name, just as shown below.
![command to compare folders command to compare folders](https://i.stack.imgur.com/coEch.png)
You will see the lines which are different in the output below. You can use the fc command to compare both the files, as shown below. In the terminal window, go to the location where the files are saved using the CD command.įor example, cd C:UsersUrviDesktopFolder 1 This can be useful for the developers and writers with files with different versions to know the difference between two files. You can compare two files as well with the Command Prompt. Well, if you just want to know missing files in the source and destination folder, the robocopy command is perfect. Therefore, some users may find the output very simple and not that informative as comparison tools. The files which are present in both folders are not displayed in the output. Similarly, sshot-2.png and taskkill.lnk are present in Folder 1 and not Folder 2. Here, abc.bat, sshot-6.png, and sshot-8.png are present in Folder 2 and not in Folder 1. The output of this command will be as below. Make sure you type in the right path of the folder/directory otherwise, you will get errors while executing the command. The command will look like this: robocopy "C:UsersUrviDesktopFolder 1" "C:UsersUrviDesktopFolder 2" /L /NJH /NJS /NP /NS robocopy command execution You need to add both the location of the folders in the command. robocopy “Folder 1 Path” “Folder 2 Path” /L /NJH /NJS /NP /NS In the Command Prompt terminal, type the below command and press Enter. Open Command Prompt from the search results.
COMMAND TO COMPARE FOLDERS FULL
If you omit the /NDL option, it is necessary to include the /FP option if you want full paths listed for each file.Press Windows key + S and type cmd in the search bar of the Start menu.
![command to compare folders command to compare folders](https://www.araxis.com/merge/documentation-windows/en/img/screenshots/folder-comparison-example.png)
fp Include the full path of files in log (only necessary if you omit /ndl) l Don’t modify or copy files, log differences only e Recurse through sub-directories (including empty ones) ROBOCOPY “\\FileShare\SourceFolder” “\\FileShare\ComparisonFolder” /e /l /ns /njs /njh /ndl /fp /log:reconcile.txt Explanation of the command switches used above: So here’s the command to perform a basic comparison of two folders and write a log file listing the differences. It has a ton of great features such as multi-threaded file copying, selectively copying changed files, and resumable copies that make it a must especially for big file copy jobs over flaky network connections. It is a supercharged version of XCopy that has been included with Windows since Vista. If you are not familiar with RoboCopy, and you do a lot of mass copying of files, you need to stop what you are doing and learn about it pronto. Necessity mothered some invention and I found an inventive way to use a combination of command switches on RoboCopy to perform the comparison. BC was having a lot of trouble and choked on many of my comparisons.
![command to compare folders command to compare folders](https://comparesuite.com/wp-content/uploads/2014/09/check_compare_tool.gif)
However, today I was doing a reconciliation as part of a very large file migration project that required comparing two folders that each contained hundreds of millions of files spread across thousands of sub-folders.
COMMAND TO COMPARE FOLDERS INSTALL
It is an excellent utility, and one that I think should be among the first utilities any developer should install on a new machine. In most cases where I need to compare two folders recursively on a Windows system I use my go-to tool Beyond Compare.