Run Compare v2 in cmd
-
I am trying to run a comparison of two files from the command line.
The command I have researched online is Notepad++\plugins\ComparePlugin\compare.exe file1 file2I navigate to Notepad++\plugins\ComparePlugin but there is no compare.exe file. I only see git2.dll and sqlite3.dll
In the plugins directory there is a ComparePlugin.dll file but no .exe file. I tried reinstalling the Compare plugin but still no .exe file.
Does anyone know how I can run the compare from the command line without the .exe?
-
Compare Plugin stopped distributing the compare.exe at some point. And there is no built-in way of running specific features of a plugin from the command line – unless the plugin has made use of Notepad++'s
-zfeature… but ComparePlugin has not (at some point, one of you who is looking for compare-starting-from-command-line should make a request in the Compare Plugin issues/feature-request page ).However, last month’s conversation on a similar request has some pointers for how to get started making a PythonScript solution to parse the Notepad++
-zfeature, after which the PythonScript could start the ComparePlugin comparison on the two files. -
Thanks for the info. I’ll look into the scripting solution
-
Hello, @eric-castilleja, @peterjones and All,
The diff-wiever
compare.exeexists in the oldComparePlugin.v1.5.6.6.bin.ziparchive and, probably, in thev1.5.6.7version, too !Unfortunately, this program is absent in all further releases of the
ComparePlugin
So here is the road map :
-
1) With the
Plugin Admin, install the lastv2.0.1release of thecomparePlugin. ( You may also install it, manually, from that link -
2) Now, download the old
1.5.6.6.version of the Compare plugin, from :
https://bitbucket.org/uph0/compare/downloads/ComparePlugin.v1.5.6.6.bin.zip
-
3) From the
ComparePluginfolder of that archive, extract the two files,compare.exeandcompare.ini, only :-
In the folder
%AppData%\Notepad++\plugins\ComparePlugin\ComparePlugin, along with the two librariesgit2.dllandsqlite3.dll, if you previously installed Notepad++, with the Installer -
In folder
<N++ installation> folder\plugins\ComparePlugin\ComparePlugin, along with the two librariesgit2.dllandsqlite3.dll, if your installation of N++ was a local installation, from a7zorziparchive, in any folder
-
-
4) Only in case of a local installation of Notepad++, you must configure the
compare.inifile, by adding, in the[Notepad]section, the line :
path=<ABSOLUTE path of Notepad++>\notepad++.exeNotes :
The environment variables, as, for instance,
%PROGRAMFILES(X86)%or%USERPROFILE%and/or the special directories.and..can be used to constitute the absolute path of N++, needed in thecompare.inifile ( NO need to surround all the path, with single or double quotes, if your path contains spaces )Remark :
In case of a local N++ installation, the two files
compare.exeandcompare.inican be placed anywhere, as soon as they are, both, in the same folder ! ( Just remember that absolute path, for further use, of course ! )-
5) Now, close any running instance of Notepad++
-
6) Then, from the “Start” menu, run a
cmdcommand -
7) Inside the DOS console window, whatever the current directory, type the command :
<ABSOLUTE path of compare.exe\compare.exe ABSOLUTE or RELATIVE path\File_A ABSOLUTE or RELATIVE path\File_Bwith a space character after the expressions compare.exe and File_A
=> Your current Notepad++ should start, soon, with, only, the two
File_AandFile_Bfiles, already compared ;-))
For instance, with my local N++
7.9.2configuration :-
The
compare.exeandcompare.inifiles are, both, in theD:\@@folder -
The
compare.inifile contains the active linepath=D:\@@\792\notepad++.exe, within the[notepad]section -
All files and sub-folders, of my local N++ installation, are in folder
D:\@@\792 -
After starting a
cmdcommand and acd /d D:\@@\792command -
I just typed the command
D:\@@\compare.exe license.txt license_2.txtwherelicense_2.txtis a copy oflicense.txt, slightly modified
=> Notepad++
v7.9.2started with the two files opened in each view, and the comparison process terminated ;-)) Just as you would have run the commandnotepad++ -nosession license.txt license_2.txtwith, in addition, the comparison process already launched !Notes :
-
When using
compare.exe, remember to indicate, in theDOScommand, its absolute path ! -
Of course, the location of two compared files can be completely independent
-
If a path of the files to compare ( absolute or relative ) contains spaces, just surround it with double quotes
-
I used the
v7.9.2release for tests but this method should work with later versions !
Best Regards,
guy038
P.S. :
This post is an update of this old post
Moreover, you might be interested in the @dinkumoil’s solution, too, which comes next !
-
-
Has there been any update in this? I too and trying to script compares for my clients but the compare.exe is still missing. Is there an effort to get the program back in the new release?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login