Redirecting STDOUT to STDIN (piping) is supported by CMD.EXE, not Vbscript (WSH).

To pipe the output of an executable to the input of another process in Vbscript simply involves using CMD.EXE to run them.

The location of CMD.EXE is defined by the %comspec% environment variable.


If you wanted to run dsquery user -samid %username% -o dn | dsget user -memberof from a Vbscript, use:
Dim oUserDN                              set oShell = createobject("")                              mystr = "dsquery user -samid %username% -o dn | dsget user -memberof"                              set oUserDN = oShell.exec("%ComSpec% /c 
& mystr &
") Wscript.Echo oUserDN.StdOut.readall