Any reason why you're not using the execution operator and storing the information in a variable to use?
e.g.
$output = `ping 127.0.0.1`;
//this is for windows... it's a different command for unix or linux
I ask because I'm not clear on if you are doing this already and are having your issue, or are calling the executable in a command windows itself.
If you are using the executaion operator... just disregard my stupidity.