More robust Windows error handling for batch