Thanks 440bx,
I look into Powershell, it's very useful and can get information from remote PC.
I meet another problem when I using Powershell with Lazarus.
I want to get output from Powershell to my program.
But when I run following code, Powershell doesn't return result and my program waiting, only when
I close Powershell, then my program can get result.
Can you help me where is wrong for my code?
Code as here:
procedure TForm1.btnPowerShellClick(Sender: TObject);
var
Process2: TProcess;
begin
Memo2.Clear;
Process2:=TProcess.Create(Form1);
Process2.Options:=[poUsePipes,poWaitOnExit,poStderrToOutPut];
Process2.Executable:='PowerShell.exe';
Process2.Parameters.Add('Get-WmiObject -Class Win32_BIOS -ComputerName .');
Process2.Active:=True;
Memo2.Lines.LoadFromStream(Process2.Output);
end;