<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML lang="en">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<link href="style.css" rel="stylesheet" type="text/css">
<title>3.2. Do something (intro)</title>
<script src="show_matches.js" type="text/javascript"></script>
</HEAD>
<BODY>
<h3>3.2. Do something (intro)</h3>
<p>The main principle of NppExec is
    the same as Notepad++'es &quot;Run...&quot; command (F5): to execute a command given.
    Usually it means to run some program/tool with specified parameters which
    can be
    passed in a form of Notepad++'es environment variables. For example, it allows
    you to launch your current file in Internet Explorer or to compile your current
file using certain compiler. NppExec provides additional abilities for this:</p>
<blockquote>
  <p>- it has a Console window to show the console program's output</p>
  <p>- it allows you to execute several commands one after another</p>
  <p>- it supports all Notepad++'es environment variables plus several own variables</p>
  <p>- it has additional commands which allow you to do more than you expect :)</p>
  <p>- it is cool :)</p>
</blockquote>
<p>NppExec actually provides four different ways to execute some command(s):</p>
<ol>
  <li>using
        NppExec's Console <a href="3.5.html">[3.5]</a> - allows you to enter some command and execute
        it by pressing Enter;</li>
  <li>using
        the dialog &quot;Execute NppExec Script...&quot; <a href="3.6.html">[3.6]</a> - allows you to enter several
        commands (which will be executed one after another) and to save these
        commands as NppExec's script;</li>
  <li>using
        NppExec's command &quot;npp_exec &lt;script&gt;&quot; - allows you to execute
        commands from existing NppExec's script <a href="3.7.html">[3.7]</a>;</li>
  <li>using
        NppExec's command &quot;npp_exec &lt;file&gt;&quot; - allows you to execute
        commands from existing text file <a href="3.7.html">[3.7]</a>.</li>
</ol>
<p>By the way, NppExec uses the 3rd way (described above) for its menu items which allow you to execute some NppExec's script.</p>
<p>Remarks:</p>
<p>NppExec by itself understands only its own internal commands and environment variables. When you type another command,
    such as &quot;copy&quot;, &quot;cmd&quot; or &quot;calc&quot;, NppExec tries to run it as a child process - i.e. it performs CreateProcess(...) and waits until this process ends.
    (Note: NppExec ver. 0.6 RC3 introduces a new advanced option <em>&quot;ChildProcess_RunPolicy&quot;</em> that allows to modify this behavior. Refer to <a href="4.4.html">[4.4]</a> for more details.)</p>
<p>When you type something like &quot;npp_run cmd&quot; or &quot;npp_run calc&quot;,
    NppExec tries to run specified command (the argument of npp_run) as an external
    process - i.e. it performs ShellExecute(...) and does not care about this process.</p>
</BODY>
</HTML>
