original appears to have been written by Steve Donovan.

IIRC, without this, Lua extensions for SciTE aren't able to run external programs, at least without showing a distracting window that briefly flashes on the screen.

gavin holt:

I used the shell.dll (https://groups.google.com/forum/#!topic/scite-interest/bVeyCfZ3OIc) which has a nice shell.exec function, 
This has the appearance of piping the results to the output window. 

You can execute any string, in my example I am constructing this in the form of props[find.command]:

function help_local_search()
    if scite.GetProp("CurrentSelection") then
	props["find.what"] = '"'..scite.GetProp("CurrentSelection")..'"'
    else
	props["find.what"] = scite.GetProp("CurrentWord")
    end
    props["find.directory"] = scite.GetProp("SciteDefaultHome").."\\help"
    props["find.files"] = "*.txt"

    local success, output = shell.exec(props["find.command"], nil,true,true)
    print(">"..props["find.command"]) -- Just to mimic the normal echo of commands
    print(output)
end


I have pasted the help for shell.exec below for those who may be interested:

exec (strCommand, [strOperation], [boolNoShow], [bWaitOnReturn])

--Run external programm or open file with associate application. Allows to execute files, documents and links and to open folders in Windows Explorer.

Parameters:
	strCommand 	- filename or folder with possible startup parameters. Can contain %environments_variable%
	strOperation 	- executed operation from listed in the table:
	boolNoShow 	- true | false (default) - silent or show a window of the started program
	bWaitOnReturn 	- true | false (default) - boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script


Operation Description
open 		Open. strCommand - filename or folder name (default)
edit 			Edit. Opens a file for editing. strCommand should be the document.
print 		Print. strCommand should be the document.
explore 	`	Opens a folder in Explorer window (with two panels). strCommand - file or folder
select 		Opens a folder in Explorer window and chooses the specified folder or a file. strCommand - file or folder
find 			Showing a dialog box "File Search". strCommand should specify a folder path from which search will begin
properties Showing file|folder "Properties" window. strCommand - file or folder
other 		Other operation available in context menu of a file. For example "Play" operation available for media files.


Return value:
  The first contains
    - at successful end: true or (if function has been started with parameter bWaitOnReturn = true), exit code of process
    - at failure: false
  The second value contains error/success message of operation;
  or contains the output text of the console application (if execute console applications with parameters boolNoShow = true and bWaitOnReturn = true)

Example:

-- run application
shell.exec("clipbrd.exe")
shell.exec("CMD /c IPCONFIG /all > out.txt", nil, true, false)

-- show result of console application
print( shell.exec("CMD /c DIR", nil, true, true) )
print( shell.exec("cscript /nologo %WINDIR%\\system32\\eventquery.vbs /?", nil, true, true) )

-- analysis of the exit code of process
if shell.exec("ping -n 1 localhost", nil, true, true) == 0 then
    print("Network works") else print("Network does not work")
end

-- open folder
shell.exec("%TEMP%")
shell.exec("%USERPROFILE%", "find")
shell.exec("%WINDIR%\\regedit.exe", "explore")
shell.exec("%ProgramFiles%", "properties")
shell.exec("%ComSpec%", "select")

-- open URL link
shell.exec("http://scite.net.ru/")

-- send e-mail
shell.exec("mailto:support"at"gmail.com")

-- open file (with associate application)
shell.exec("%WINDIR%\\WindowsUpdate.log")

-- print file
shell.exec("%WINDIR%\\win.ini", "print")

-- edit file
shell.exec("%WINDIR%\\winnt.bmp", "edit")

Kind Regards

Gavin
