<?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[Execute bat-file from Notepad++]]></title><description><![CDATA[<p dir="auto">Is there any easy and convenient way to run currently opened bat-file from Notepad++?<br />
For example, with a hotkey or a menu or addon?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26045/execute-bat-file-from-notepad</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 04:42:38 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26045.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Aug 2024 17:41:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Execute bat-file from Notepad++ on Fri, 23 Aug 2024 21:18:36 GMT]]></title><description><![CDATA[<p dir="auto">Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/96268</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96268</guid><dc:creator><![CDATA[Anton]]></dc:creator><pubDate>Fri, 23 Aug 2024 21:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to Execute bat-file from Notepad++ on Fri, 23 Aug 2024 18:01:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29356">@Anton</a> said in <a href="/post/96261">Execute bat-file from Notepad++</a>:</p>
<blockquote>
<p dir="auto">Is there any easy and convenient way to run currently opened bat-file from Notepad++?<br />
For example, with a hotkey or a menu or addon?</p>
</blockquote>
<p dir="auto">Keep in mind that batch files are normally run from a command prompt window. My normal practice has been to edit the batch file in Notepad++ and to then <code>Alt+Tab</code> to a command prompt window to test the batch file. Windows does not offer a direct mechanism for an application such as Notepad++ to tell a process such as cmd.exe to execute a batch file. That’s why you need to switch using <code>Alt+Tab</code> as Microsoft wants the user to be in control.</p>
<p dir="auto">However, you can “run” a batch file from Notepad++ by telling it to open a new command prompt window and that command prompt runs your batch file.  There are two ways to do this:</p>
<p dir="auto">Add a <code>file://c:/bin/batch_file.bat</code> link.  When you double-click the link it’ll open a command prompt window that’s running your batch file. When the batch file exits the command prompt window goes away. Thus you likely will want to add a <code>PAUSE</code> command or some other mechanism for suspending the batch file so you can view the results.</p>
<p dir="auto">Another way is to take advantage of the <code>Run / Run</code> command and to point that at your batch file. Unfortunately, there does not see to be a way to add custom entries to the Run menu so that you can set up a Notepad++ keyboard shortcut that runs a a batch file.  As with the <code>file://</code> links you will end up with a new command prompt window that then vanishes at the end of execution. You can add <code>/K</code> to the string to<br />
run cmd.exe to keep it open when the batch file terminates though then would then need to manually close those windows.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/96264</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96264</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Fri, 23 Aug 2024 18:01:36 GMT</pubDate></item><item><title><![CDATA[Reply to Execute bat-file from Notepad++ on Fri, 23 Aug 2024 17:49:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29356">@Anton</a> ,</p>
<p dir="auto">The <strong>File &gt; Open in Default Viewer</strong> will run the current file based on its windows filetype assocation, which would run the batch.  So <strong>Settings &gt; Shortcut Mapper</strong> could assign a keystroke to that menu entry, if you wanted.</p>
<p dir="auto">Or <strong>Run &gt; Run…</strong>, <code>$(FULL_CURRENT_PATH)</code> – which you can <strong>Save</strong> to a named run-command, and give it a keyboard shortcut</p>
]]></description><link>https://community.notepad-plus-plus.org/post/96262</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96262</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 23 Aug 2024 17:49:53 GMT</pubDate></item></channel></rss>