<?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[Opening file with command line in an existing instance]]></title><description><![CDATA[<p dir="auto">I want to open a file via command line in cmd to an existing instance. I know I can set setting to default(mono-instance) in preference settings -&gt; multi-instance setting. But I don’t want to use mono-instance normally, I only want to use mono-instance via cmd.</p>
<p dir="auto">So is there any possible way to open file in as existing instance with cmd?, while multi-instance setting is on “always in multi-instance mode”.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24846/opening-file-with-command-line-in-an-existing-instance</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 09:11:01 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24846.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Aug 2023 14:49:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Opening file with command line in an existing instance on Tue, 22 Aug 2023 11:11:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> Oh my gosh, that’s all I needed. Thank you so much, I made batch file also, it makes me so comfortable.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88817</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88817</guid><dc:creator><![CDATA[Eli Grey]]></dc:creator><pubDate>Tue, 22 Aug 2023 11:11:10 GMT</pubDate></item><item><title><![CDATA[Reply to Opening file with command line in an existing instance on Mon, 21 Aug 2023 15:15:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/eli-grey" aria-label="Profile: Eli-Grey">@<bdi>Eli-Grey</bdi></a> said in <a href="/post/88788">Opening file with command line in an existing instance</a>:</p>
<blockquote>
<p dir="auto">there any possible way to open file in as existing instance with cmd?, while multi-instance setting is on “always in multi-instance mode”.</p>
</blockquote>
<p dir="auto">No, but the opposite is easy: if you normally have notepad++ in mono-instance (via the settings), opening a single time in a separate instance from the command line is easy (with the <code>-multiInst -nosession</code> <a href="https://npp-user-manual.org/docs/command-prompt/" rel="nofollow ugc">command line arguments</a>)</p>
<p dir="auto">But, I suppose, if you have the normal settings (stored in <code>%AppData%\Notepad++</code>) with multi-instance enabled, you could run from the command line using an alternate settings directory.  So</p>
<ol>
<li>Copy <code>%AppData%\Notepad++\config.xml</code> to some alternate directory (I will use the example <code>c:\usr\local\apps\npp\altSettingsDir\config.xml</code>)</li>
<li>Edit that new config.xml, and <code>&lt;GUIConfig name="multiInst" setting="2"</code> to <code>&lt;GUIConfig name="multiInst" setting="0"</code> .  Save</li>
<li>From command line,
<ul>
<li><code>notepad++ change.log</code> will open <code>change.log</code> using the normal multi-instance rules</li>
<li>the alternate <code>notepad++ -settingsDir="c:\usr\local\apps\npp\altSettingsDir\" change.log</code> will use the alternate config file location, and thus <em>not</em> use multi-instance mode, and it will pick one of the already-open Notepad++ instances for editing the file</li>
</ul>
</li>
</ol>
<p dir="auto">If you like that, you could set up a batch file in your path <code>npp-mono.bat</code>, which would call <code>@notepad++ -settingsDir="c:\usr\local\apps\npp\altSettingsDir\" %*</code>, so that you wouldn’t have to type that long -settingsDir argument every time.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88790</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88790</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 21 Aug 2023 15:15:40 GMT</pubDate></item></channel></rss>