Handling of piping error

Added on pipe close returns exit code
'program' is not recognized as an internal or external command,
operable program or batch file.