Fix an issue with cmd.script in Windows so that the exit code from a script will be passed through to the retcode of the state