I do some xcopy commands (batch Task) to copy files sometimes when needed in my scripts to the local machine. The problem is as of late they have been coming back with an exit code of 2. I know this because I have error conditions to tell me this.
:xcopy
start /wait xcopy "\\ber-ap15\Installs\VPNConfig" "C:\RISLOG\vpn\" /v /y /e /q /d
echo %date%,%time%,errorlevel: %errorlevel%,487 Copy vpn Configuration File: End >> c:\RISlog\altiris.log
if errorlevel 0 if not errorlevel 1 goto :488
if errorlevel 1 if not errorlevel 2 goto :fail
if errorlevel 2 if not errorlevel 3 goto :ctrlc
ctrlc returns back to altiris a specific EXIT XXX code that tells why this failed. I get the errorlevel 2 like 30% of the time. If I rerun the task again right after this it then is successful.
As I know this is specific there seems to be something going on causing this failure in Altiris. Wondering if anyone else has experienced this?