Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

sql agent job cmdexec step with robocopy

$
0
0

I have below code in sql agent job step of type cmdexec . This step is supposed to copy a file using robocopy and based on the return code apply the if logic to return 0 .

My issue: robocopy step is working but not the if logic. Job is returning what ever the return code returned by robocopy.

ROBOCOPY c:\Source  D:\destination myfile.txt  ^& IF %ERRORLEVEL% LEQ 1 exit 0


Ravi Kumar


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>