<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Open two files side by side from command line]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I’d like to do what the title says: create one <code>.cmd</code> file that’ll fire up Notepad++ and show me the two files side by side. I have checked the CLI reference and can see how to open two files via command line but I couldn’t see how to do the side-by-side thing.</p>
<p dir="auto">The purpose is this: I have created a python script that compares a lot of different text files. Interesting file pairs that need closer investigation are put into separate folders for easy navigation. This works great but I still need to open every file pair and drag them around inside of Notepad++. I’d like to automatically create a <code>.cmd</code> file for each pair that’ll immediately open the files side-by-side and thus reducing the amount of repetitive clicking around.</p>
<p dir="auto">Thanks in advance!<br />
Max</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21429/open-two-files-side-by-side-from-command-line</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 10:29:27 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21429.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Jul 2021 20:36:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Open two files side by side from command line on Mon, 05 Jul 2021 11:41:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mmmzzzz" aria-label="Profile: MMMZZZZ">@<bdi>MMMZZZZ</bdi></a> said in <a href="/post/67629">Open two files side by side from command line</a>:</p>
<blockquote>
<p dir="auto">ü</p>
</blockquote>
<p dir="auto">not 100% sure what the issue is. The generation of the session file or opening the sessions with npp?</p>
<p dir="auto">What I did is the following:</p>
<p dir="auto">a) created a file <code>D:\über.txt</code><br />
b) created a file <code>D:\temp\ökonmische betrachtung\ärger.txt</code><br />
c) moved the second file to the second view<br />
d) used <code>File-&gt;SaveSession</code> and saved it as <code>D:\test_session.xml</code><br />
e) open a cmd and started <code>D:\Tests\npp\810\x64\notepad++.exe -openSession D:\test_session.xml</code></p>
<p dir="auto">resulted in</p>
<p dir="auto"><img src="/assets/uploads/files/1625484715960-613d2d9c-ef38-44cc-b59f-2f38573a23e7-image.png" alt="613d2d9c-ef38-44cc-b59f-2f38573a23e7-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">To reuse this mechanism, I would modify the session.xml file and replace the two filename tags with something unique like <code>%%FILE1%%</code> and <code>%%FILE2%%</code> and then have my script replace them with the real name of the file, making sure they are xml encoded.<br />
As a template, of course. The script would create the real session file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67699</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67699</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 05 Jul 2021 11:41:53 GMT</pubDate></item><item><title><![CDATA[Reply to Open two files side by side from command line on Fri, 02 Jul 2021 16:00:28 GMT]]></title><description><![CDATA[<p dir="auto">Oh lord the encodings are killing me…</p>
<p dir="auto">Filepaths in the session.xml file somehow need to escape characters even though cp1252 and UTF-8 are well capable of encoding them directly (f.ex. <code>ü</code>)… Then the python <code>xmlcharrefreplace</code> option encodes them with decimal number (<code>&amp;#252;</code>) instead of hex (<code>&amp;#00FC</code>) - which notepad++ won’t accept. And finally, the CLI option <code>-ope1nSession</code> doesn’t seem to handle filepaths with any of the versions above.</p>
<p dir="auto">To make things even better, if <em>anything</em> of all the above doesn’t work, notepad++ doesn’t give you any hint. it just opens a blank new file. I couldn’t find any <code>--verbose</code> option for the CLI either.</p>
<p dir="auto">Help would be appreciated before I go insane…</p>
<p dir="auto">Max</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67629</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67629</guid><dc:creator><![CDATA[MMMZZZZ]]></dc:creator><pubDate>Fri, 02 Jul 2021 16:00:28 GMT</pubDate></item><item><title><![CDATA[Reply to Open two files side by side from command line on Fri, 02 Jul 2021 13:48:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> I played a bit with the sessions file and the command line options. I don’t fully understand the behavior but I got something that works. Thanks a lot!</p>
<p dir="auto">Max</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67621</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67621</guid><dc:creator><![CDATA[MMMZZZZ]]></dc:creator><pubDate>Fri, 02 Jul 2021 13:48:30 GMT</pubDate></item><item><title><![CDATA[Reply to Open two files side by side from command line on Fri, 02 Jul 2021 10:41:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mmmzzzz" aria-label="Profile: MMMZZZZ">@<bdi>MMMZZZZ</bdi></a></p>
<p dir="auto">just for the record, pythonscript comes with python dll so there is no need to install anything other than the plugin itself.</p>
<p dir="auto">Without plugins, the only possible solution I can think of is to create a session file, created by a batch or your python script, and then start npp with the <code>-openSession</code> parameter and the previously created session file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67610</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67610</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 02 Jul 2021 10:41:46 GMT</pubDate></item><item><title><![CDATA[Reply to Open two files side by side from command line on Fri, 02 Jul 2021 10:10:30 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for the quick reply!</p>
<p dir="auto">I did find that plugin but there are 2 issues:</p>
<ul>
<li>I’m not the only one who’ll use this script and I’d prefer solutions that work “out of the box” without extra plugins to install. If it’s not possible without those, okay, better than nothing, but IMO for this case it’s the second choice</li>
<li>PythonScript seems to be based on Python 2 which I don’t have installed, never used and honestly didn’t plan to learn/use since it’s deprecated. There is a Python 3 version in development but if I understand the release notes correctly it doesn’t work for non-unicode files (which I have to deal with). I haven’t looked any deeper into this; maybe there’s a workaround for that…</li>
</ul>
<p dir="auto">If you got any other ideas I’d be very thankful! Otherwise I guess I’ll have to try with PythonScript…</p>
<p dir="auto">Kind regards,<br />
Max</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67608</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67608</guid><dc:creator><![CDATA[MMMZZZZ]]></dc:creator><pubDate>Fri, 02 Jul 2021 10:10:30 GMT</pubDate></item><item><title><![CDATA[Reply to Open two files side by side from command line on Thu, 01 Jul 2021 21:13:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mmmzzzz" aria-label="Profile: MMMZZZZ">@<bdi>MMMZZZZ</bdi></a></p>
<p dir="auto">If you’re a Pythoner, doing this using the PythonScript plugin should be fairly easy.<br />
Do you want to take a look at doing that all by yourself, or do you want some guidance?</p>
<p dir="auto">Since you mentioned comparing, you may take a look at the <em>Compare</em> plugin.<br />
Since I don’t use it, I can’t advise any further on if it can auto-open two files passed in on N++ startup (I doubt it, though).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67597</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67597</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 01 Jul 2021 21:13:37 GMT</pubDate></item></channel></rss>