I have a simple batch file that moves files from one folder to another - the source folder is a network path in the form \SERVERNAME\g$\Extract. The full command is:
move \\SERVERNAME\g$\Extract\updates*.txt D:\Import\NewFiles
I can run this batch file manually and it works fine. However, I've set it up as a scheduled job (on the destination server) and every time it runs, it shows:
Task Scheduler successfully completed task "\Transfer files" , instance "{3885bcd7-7b78-4de6-a95d-c6ab7b4d480b}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 2147942401.
The job runs as a user who has full access to both the source and destination folders and has rights to "Log on as a batch job" as well. Both servers are Windows Server 2012.
The job has the following specified:
- Run whether user is logged on or not
- Do not store password
- Run with highest privileges
- Configure for: Windows Server 2012 R2
In the Action panel, I've put the batch file name in the Program/script box both with and without it's full path. I've also tried including and excluding the path in the "Start in" box.
I've tried sharing the source folder, giving full control to the user the batch job is running as, and then using both the share name and the full network path but that also hasn't resolved the problem.
Whatever I try, the task still completes with the same exit code and the batch file doesn't run.
I've spent ages searching around for this and though there appear to be plenty of other people who've experienced this same exit code, none of the things suggested have worked.
Can anyone suggest why this might be happening or what I can try to get round it? Is it something to do with the source folder being a network path?
I'm under a bit of pressure to resolve this so any suggestions would be much appreciated.
Thanks