Maybe something like this?
code:
Function WshPipe($Command,optional $Ignore)
Dim $Exit,$Output,$i,$Array[4096]
$WshShell=CreateObject("WScript.Shell")
$oExec=$WshShell.Exec($Command)
$i=0 $Limit=UBound($Array)
While $Exit<>1
Dim $Output
$Output=ReadAll($oExec)
If $Output=-1
If $oExec.Status=1
$Exit=1
EndIf
Else
If $Ignore And InStr($Output,'File not found')<>0?
$Output=''
EndIf
If $Output
$Array[$i]=$Output
If $i=$Limit
$Limit=$Limit*2
Redim Preserve $Array[$Limit]
EndIf
$i=$i+1
EndIf
EndIf
Loop
If $i>0
Redim Preserve $Array[$i-1]
$Pipe=$Array
EndIf
Exit($oExec.ExitCode)
EndFunction
Function ReadAll($oExec)
If Not $oExec.StdOut.AtEndOfStream
$ReadAll=$oExec.StdOut.ReadAll
Exit
endif
If Not $oExec.StdErr.AtEndOfStream
$ReadAll=$oExec.StdErr.ReadAll
Exit
endif
$ReadAll=-1
EndFunction
However, i did not add the suggestion of the environment (you could add it to the command..). Also, this function returns an array like the Pipe() UDF did.
_________________________
Kind regards,