To run some program (optionally, with parameters) as a child process of NppExec, just type the (path)name of this program (optionally, with parameters) in NppExec's Console [3.5] or in the "Execute NppExec Script..." dialog [3.6]. This makes NppExec to:
For example, type
cmd
to start the "cmd.exe". You will see the cmd's output in NppExec's Console. You can type some cmd's commands in order to cmd to execute them and, finally, type "exit" in order to exit cmd.
Also you can type
calc
in order to start the "calc.exe". NppExec will wait until you close the calc's window.
Finally, here is an example with parameters:
cmd /c time /t
The last example shows the output of cmd's command "time /t" in NppExec's Console - i.e. it shows current time.
The same approach can be used to execute .bat and .cmd files - but the file extension (.bat or .cmd) can not be omitted in this case. (Note: NppExec ver. 0.6 RC3 introduces a new advanced option "ChildProcess_RunPolicy" that allows to modify this behavior. Refer to [4.4] for more details.)
To run some program (optionally, with parameters) as an external process (with respect to NppExec), type "npp_run " and the (path)name of this program (optionally, with parameters) in NppExec's Console [3.5] or in the "Execute NppExec Script..." dialog [3.6]. This makes NppExec to:
For example, type
npp_run cmd
to start the "cmd.exe" in its own window.
(Note: it's possible to start an application in its own window and make NppExec to wait until the application has been executed. To do that, type:
cmd /c start /wait application.exe
In this case, NppExec waits for 'cmd' to be executed, while 'cmd' itself starts the 'application.exe' in its own separate window and waits until it has been executed. So "npp_run " is not needed here.)
Also you can use "npp_run " to open specified file in its associated program. For example, "npp_run index.htm" opens the .htm file in your default internet browser.
See also: Using cmd.exe [4.4].