Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Process Exit Code 16 When Executing CMD.exe from SQL Agent Job

$
0
0

I am trying to run a cmd.exe line from SQL Server against a remote machine to execute a batch file. The batch file works fine when called from the local Windows Task Scheduler. I am trying to use SQL Server so I can get an email when execution of the batch file fails so as to avoid having to manually look at a log file entry every day. Below is the command I am running:

cmd.exe /c "\\MyRemoteServer\BatchFiles\CopyFusionProd4Folder.bat"

The batch file uses Robocopy to mirror a directory that has many nested folders and the path down to the files exceeds 256 characters, which is apparently the limit for using the SSIS Copy Directory task. When I execute the job I get Process Exit Code 16 which is "

Robocopy did not copy any files. Either a usage error or an error due to insufficient access privileges on the source or destination directories."

I am running SQL Server Agent with the same domain account that is an admin on the remote machine

so I am not seeing how this is a permissions issue.

 Any help or explanation on this would be appreciated. 

Lee Markum


Viewing all articles
Browse latest Browse all 24688

Latest Images

Trending Articles



Latest Images

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