The incorrect path separator is being used internally when redirecting output which is causing the command to fail immediately.  The global variables #global:cmdresult# or #gloval:psresult# will not be initialized so any test of the values will fail too.