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 "Any help or explanation on this would be appreciated.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.
Lee Markum