Windows Server 2008 CMD Task Schedule not running

batch-filetask-schedulerwindows-server-2008

I have a BAT/CMD file that when run from the command prompt runs completely. When I run it through the Task Scheduler it partially runs.

Here is a copy of the file

cd\sqlbackup
ren Apps_Backup*.* Apps.Bak
ren Apps_Was_Backup*.* Apps_Was.Bak
xcopy /Y c:\sqlbackup\*.bak c:\sqlbackup\11\*.bak
xcopy /y c:\sqlbackup\*.bak \\igweb01\c$\sqlbackup\*.bak
Move /y c:\sqlbackup\*.bak "\\igsrv01\d$\sql backup\"

The last two lines do not run when the task scheduler calls it. But again, work when manually run from the command line.

All the local sever commands run but when it comes to the last two lines where it goes to another server then it does not work.

Best Answer

Looks like your scheduled task user account doesn't have rights to write to \\igweb01\c$\sqlbackup and \\igsrv01\d$\sql backup.