I'm moving a repository from sourcesafe to subversion and I need to ensure that vital points are equal. Is it any existing command / tool for windows that allows me to compare two folder trees that they are equal (has equal folder structure and files of same content)? The ideal will be something command-line like:
Is it some tool / command exist or I need to write a script of my own?
Marijn8,91144 gold badges4747 silver badges7272 bronze badges
grigoryvpgrigoryvp11.9k5050 gold badges138138 silver badges255255 bronze badges
closed as off-topic by Paul Roub, Machavity, TylerH, Sam, MakyenMar 29 '18 at 23:38
This question appears to be off-topic. The users who voted to close gave this specific reason:
- 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Paul Roub, Machavity, Sam, Makyen
8 Answers
If you can use a GUI tool, the best I tried is WinMerge - open source.
If not, then diff is your friend.
Deanna21k66 gold badges5454 silver badges126126 bronze badges
PalantirPalantir18.6k88 gold badges6666 silver badges8282 bronze badges
Beyond compare allows you to do that and much more.
It's one of those tools I can't live without.
Take a look here for a reference on the scripting options
Lieven KeersmaekersLieven KeersmaekersTake a look here for a reference on the scripting options
48.4k1111 gold badges9191 silver badges129129 bronze badges
You could also execute
tree > tree.txt
in both folders and then diff both tree.txt files with any file based diff tool (git diff).halllohalllo
As I am reluctant to install new programs into my machine, this PowerShell script (from Hey, Scripting Guy! Blog) helped me solve my problem. I only modified the path to suit my case:
AhmetAhmet
SyncToy is a free application from Microsoft with a 'Preview' mode for comparing two paths. For example:
You can then choose one of three modes ('Synchronize', 'Echo' and 'Contribute') to resolve the differences.
Lastly, it comes with
SyncToyCmd
for creating and synchronizing folder pairs from the CLI or a Scheduled Task.Todd MazierskiTodd Mazierski
You can use git for exactly this purpose. Basically, you create a git repository in folder
A
(the repo is in A/.git
), then copy A/.git
to B/.git
, then change to B
folder and compare simply by running git diff.And the --exclude
functionality can be achieved with .gitignore
.So, sticking to your example (but using bash shell on Linux):
Alexey PolonskyAlexey Polonsky
Like the OP, I was looking for a Windows folder diff tool, in particular one that could handle very large trees (100s of Gigabytes of data). Thanks Lieven Keersmaekers for the pointer to BeyondCompare, which I found to be VERY fast (roughly 10-100 times faster) than my previous old school tool windiff.
BTW, BeyondCompare does have a command line mode in addition to the GUI.
Community♦
Mike RizziMike Rizzi
Did you try:https://www.araxis.com/merge/index.enIt allows to visualize changes and selectively merge specific differences in files and folders.
Valeriy PogosyanValeriy Pogosyan
Not the answer you're looking for? Browse other questions tagged comparison or ask your own question.
-->Azure Repos | Azure DevOps Server 2019 | TFS 2018 | TFS 2017 | TFS 2015 | VS 2017 | VS 2015 | VS 2013
This section explains how to compare folders and files. You can compare server folders and local folders to each other, and view the differences between the contents of each folder. You can compare two server files, two local files, or a server file against a local file and view the differences between the files.
In This Section
Compare files
Describes how to view the differences between two server files, two local files, or a server file and a local file.
Describes how to view the differences between two server files, two local files, or a server file and a local file.
Compare folders
Describes how to compare two server folders, two local folders, or a server folder and a local folder.
Describes how to compare two server folders, two local folders, or a server folder and a local folder.
Folder comparison filters
Describes the name filters that are used to match the names of files or folders you are comparing.
Describes the name filters that are used to match the names of files or folders you are comparing.
Reconcile differences between two folders
Describes how to reconcile the differences between a server folder and local folder, and how to resolve conflicting pending changes in your local folder.
Describes how to reconcile the differences between a server folder and local folder, and how to resolve conflicting pending changes in your local folder.
Associate a file type with a file-comparison tool
Describes how to associate a specific file type with a third-party compare or difference tool.
Describes how to associate a specific file type with a third-party compare or difference tool.
I would like to compare two folders, strictly for filenames. (Not the file contents). I am on windows 10 and would like to use command line tools.
Here is scenario that may explain the issue.
I did some research, and there are many
diff
tools, but I am not interested in comparing the file contents. All I want is compare two folders and output which files are missing in both folders (compared to the other one). I prefer not to use Powershell.
Thank you.
Cricrazy
CricrazyCricrazy50411 gold badge33 silver badges2020 bronze badges
3 Answers
robocopy
(included in recent Windows versions) can do this in one pass: given
source
and source2
with some files which are common and files which exist only in either folder, running robocopy source source2 /L /NJH /NJS /NP /NS
yields
D:Usersmetestsource *EXTRA Datei only_in_source2.txt Neue Datei only_in_source.txt
where lines starting with a
*
denote files only in source2
(independent of the OS language), and other lines denote files only in source
. The options suppress various output items, and
/L
takes care that differences are listed only, not copied.user1016274user1016274
Do a
dir /b /A-d
of both folders to a file and compare these with findstr and the /VG:
options Given a sample tree:
The following batch file:
yields this output:
This is a quality solid metal and wood semi-auto rifle that feels like a much more expensive center fire weapon. Stunning wood finishing, easy-to-adjust iron sights, and simple safety features add to the STG-44’s superb level of quality. Note that no bullet button is required as this is a rimfire.Heres what ATI says about it:The STG-44 (Sturmgewehr 44) was developed in Nazi Germany during WWII and was the first ‘Storm’ (or assault) rifle to see major deployment.Retaining as many of the original specs as possible, the GSG 22.LR version of this piece of history flawlessly sends rounds accurately and quickly downrange, and is perfect for casual plinking, target shooting, and hunting. Stg 44 iron sights for sale.
LotPingsLotPings5,67511 gold badge99 silver badges2424 bronze badges
This Powershell script does what you want.
That, and several other options, are discussed here: https://stackoverflow.com/questions/3804109/what-is-the-best-way-to-compare-2-folder-trees-on-windows
Doug DedenDoug Deden
Not the answer you're looking for? Browse other questions tagged windows-10command-linebatch-filecmd.exe or ask your own question.
Hello,
One more way to do this would be to use the comp command from the command prompt. Click on Start and type cmd and press enter. If you type help comp and press enter, it will return the following:
Compares the contents of two files or sets of files.
One more way to do this would be to use the comp command from the command prompt. Click on Start and type cmd and press enter. If you type help comp and press enter, it will return the following:
Compares the contents of two files or sets of files.
File And Folder Comparison Software
COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C] [/OFF[LINE]]
data1 Specifies location and name(s) of first file(s) to compare.
data2 Specifies location and name(s) of second files to compare.
/D Displays differences in decimal format.
/A Displays differences in ASCII characters.
/L Displays line numbers for differences.
/N=number Compares only the first specified number of lines in each file.
/C Disregards case of ASCII letters when comparing files.
/OFF[LINE] Do not skip files with offline attribute set.
data2 Specifies location and name(s) of second files to compare.
/D Displays differences in decimal format.
/A Displays differences in ASCII characters.
/L Displays line numbers for differences.
/N=number Compares only the first specified number of lines in each file.
/C Disregards case of ASCII letters when comparing files.
/OFF[LINE] Do not skip files with offline attribute set.
To compare sets of files, use wildcards in data1 and data2 parameters.
For example, we have two different text files, test1.txt and test2.txt. The contents of each are as follows:
test1.txt file size 22 bytes
aa
bb
cc
dd
ee
ff
test2.txt files size 20 bytes
aa
cc
cc
dd
ff
If we simply run comp without switches it will tell you if the size is different (Without /N=? it defaults to this)
-------------------------------------------
comp test1.txt test2.txt
For example, we have two different text files, test1.txt and test2.txt. The contents of each are as follows:
test1.txt file size 22 bytes
aa
bb
cc
dd
ee
ff
test2.txt files size 20 bytes
aa
cc
cc
dd
ff
If we simply run comp without switches it will tell you if the size is different (Without /N=? it defaults to this)
-------------------------------------------
comp test1.txt test2.txt
Comparing test1.txt and test2.txt..
Files are different sizes.
-------------------------------------------
Files are different sizes.
-------------------------------------------
If we add a few switches, it changes behavior. /N=10 means scan the first 10 lines of the file. /A means tell me what's different in a readable format.
-------------------------------------------
comp test1.txt test2.txt /N=10 /A
-------------------------------------------
comp test1.txt test2.txt /N=10 /A
Jun 01, 2019 Namak Halaal Songspk title/name of Song / Music / Video is delivered from Youtube and maybe containing a video's copy right. This web just only a search engine media, not a storage or cloud server from the file. We just linked the file or embed from Youtube then display them here to make visitor. Oct 21, 2015 Movie Starts At: 00:18 Namak Halaal is a story of Arjun who has come in city in search of job and eventually gets to do a job in a 5-star hotel. There he finds that many attempts are being made to. Namak halaal video songs free download hd low setting for gta v. Oct 12, 2018 Namak Halaal is a story of Arjun who has come in city in search of job and eventually gets to do a job in a 5-star hotel. There he finds that many attempts are being made to kill hotel owner Raja.
Comparing test1.txt and test2.txt..
Compare error at LINE 2
file1 = b
file2 = c
Compare error at LINE 2
file1 = b
file2 = c
Compare error at LINE 5
file1 = e
file2 = f
Compare error at LINE 5
file1 = e
file2 = f
Compare error at LINE 2
file1 = b
file2 = c
Compare error at LINE 2
file1 = b
file2 = c
Compare error at LINE 5
file1 = e
file2 = f
Compare error at LINE 5
file1 = e
file2 = f
File2 only has 5 lines
-------------------------------------------
Please let me know if that helps.
Brent -------------------------------------------
Please let me know if that helps.
Microsoft Answers Support Engineer
Visit our Microsoft Answers Feedback Forum and let us know what you think.