I use this on linux and windows:
function Run(fexec,args:string; wait:boolean):boolean;
var ffexec:string;
begin
result:=true;
try
if fileexists(fexec) then ffexec:=fexec else
ffexec:=FileSearch(fexec,GetEnv('PATH'));
if length(ffexec)<>0 then
begin
if not wait then
begin
with TProcess.Create(application) do
begin
CommandLine:=trim(ffexec+' '+args);
Execute;
end;
end else
begin
ExecuteProcess(ffexec,args);
end;
end else result:=false;
except
result:=false;
end;
end;
Dne sreda 16. novembra 2005 15:37 je Kleiton Luiz napisal(a):
> Hi, i'm try to send a commad to shell...
>
> example: i need send to shell a command "ls" and save results in a file
> "lists.txt"
>
> in a shel this command make this job:
>
> $ ls > lists.txt
>
> i need in Lazarus execute this command.
>
> anypeople can help me ? Thanks !
>
>
>
>
>
>
> ---
> ----------------------------------------------+
> Kleiton L R Soares (cel. 9639-5829)
> Analista de Sistemas - ADM. Redes
> ICQ.: 132279038 MSN.: [EMAIL PROTECTED]
>
> "Quem conhece a sua ignorância revela a mais profunda sapiência.
> Quem ignora a sua ignorância vive na mais profunda ilusão".
> (Lao-Tsé).
>
>
>
>
>
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.
--
bye,
...s]-[it happens...
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives