thanks for the update, your new first test is way cleaner...
(just trying to simplify at most the tests and avoid calling external findstr, you could do
`type foo-out 2> NUL || echo good`
`type foo-err 2> NUL || echo bad`
should output
`good`
`foo`
(does work on native, should work on wine but didn't test it though)