[# VS2012] HowTo: Compare 2 files using Visual Studio from the command line



some time ago I spoke of the possibility of Configure WinMerge to be used as a tool by default for Diff and Merge within Visual Studio 2010. With Visual Studio 2012 has been incorporated a new Diff and Merge tool that the truth is that it works very well (something talked here about this new tool)

Now, if we want to compare 2 files in a simple way, because the IDE is not all intuitive to find this option.Fortunately, the command line gives us the answer in the following format:

devenv.exe/diff Compares two files. Takes four parameters:
SourceFile, TargetFile, SourceDisplayName (optional),
TargetDisplayName (optional)

And then launch a command of style

C:\Program Files (x 86) \Microsoft Visual Studio 11.0\Common7\IDE > devenv.exe/diff
“e:\source.txt” “e:\target.txt””SOURCE””TARGET”

We will see something similar to the following


Saludos @ La Finca

El Bruno

image image image

1 comment

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: