Here's my entry:
Code:
break ON
$ShellCMD = '%comspec% /c dir c:\data\scripts\ /b /a:d /s'
? "Running: $ShellCMD"
$dirs = WSHPIPE($ShellCMD, 1)
? "directory count = " + ubound($dirs)
Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
;While Not $oExec.Status Loop
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho ? $Output Endif
$WshPipe=Split($Output,CHR(10))
Exit($oExec.ExitCode)
EndFunction

_________________________
Home page: http://www.kixhelp.com/hb/