I need to create a console application that runs a command and get the return from command and save it to a variable. Can someone help me?
Below is the code I have made so far.
procedure TSDKMonitor.DoRun;
Var
cmd: TProcess;
Result: string;
begin
try
cmd := Tprocess.create(self);
cmd.commandLine := 'ls -la';
cmd.Execute;
Finally
cmd.free;
end;
end;