While I know this is not what you want. I was able to run a DOS command in a script and push the stdout in to a variable which I was then able to parse.
This would be a horrible way to get the output of a simple DOS command like %USERNAME%, but it worked ok for reading the result from an exe that I was running. I used it in this script to read the output from the unrar.exe.