Free Pascal Lazarus Program Tutorial 28 - Running External Programs


To execute an external program from within the pascal code is a simple process. TProccess will do it quickly. TProcess requires Process added to the uses area.

This is the TProcess Setup

uses Process;
var
RunProgram: TProcess;
begin
RunProgram := TProcess.Create(nil);
RunProgram.CommandLine := ‘Path and Name of Program’;
RunProgram.Execute;
RunProgram.Free;
end;

TProcess Links

Lazarus (Free Pascal) Wiki article on executing external programs.
wiki.lazarus.freepascal.org/Executing_External_Programs

TProcess Code
lazarus-ccr.sourceforge.net/docs/fcl/process/tprocess.html

TProcess Help For Mac
www.mail-archive.com/lazarus@lazarus.freepascal.org/msg01971.html

TProcess Help For Linux
www.mail-archive.com/lazarus@miraclec.com/msg20819.html

Code Download
FPProgT28.zip