The command is:
Dir |yourApp
Simply check StdInputHandle in your app.
When used as above, StdInputHandle is not going to be 0.
To read the data, use Windows API
Or
use THandleStream.
Or
Assign the handle to a text variable, and use ReadLn
Edit:
Sample code:
var
s:string;
hs: THandleStream;
begin
if StdInputHandle>0 then
begin
hs:=THandleStream.Create(StdInputHandle);
SetLength(s,hs.Size);
hs.Read(s[1],hs.Size);
memo1.Text:=s;