How do I compare two folders to see which files are different?
Quick answer
First compare the folders’ file lists, including subfolders, to find files present on only one side. For files with matching paths, record size and modified time as metadata, then use a content comparison or hashes to check contents when needed. Windows’ comp command compares file contents, while PowerShell’s Get-FileHash can compare selected files. Review the results before changing either folder.
The question, the details, the next step.
A practical checklist
Choose Folder A and Folder B and record their locations without changing either folder.
Compare relative paths, including subfolders, and list entries found only on each side.
For paths present in both, record size and modified time as metadata, not as a content check.
Use a content comparison or hashes for files whose contents need verification.
Record the method and result separately from any decision about which version to keep.
Review differences before merging, overwriting, or deleting files.
A few more useful answers
Does a matching file name mean the files are identical?
No. Names identify entries, not their contents. Compare the corresponding files’ contents if you need to check whether they match.
Does a matching hash compare the folder structure too?
No. A hash checks file contents, not paths, names, timestamps, or whether a file is missing from one folder. Compare the inventories separately.
Can WinDiff compare every kind of file?
The cited Microsoft description scopes WinDiff to folders containing ASCII text files and does not establish arbitrary binary-file comparison. Use a method suited to the contents you need to check.
Sources
References used for this guide.
- [S1] How to use the Windiff.exe utility to compare folders learn.microsoft.com · Checked
- [S2] comp command: compare files or sets of files learn.microsoft.com · Checked
- [S3] Get-FileHash: calculate and compare file content hashes learn.microsoft.com · Checked
