Your command is not exactly like I read at http://www.ss64.com/nt/schtasks.html
Try making it the same in every detail. Hint? CMD vs. BAT
I am trying to write a script that will schedule a daily backup of some files. I am using SCHTASK to do this. I can get the task scheduled in the task scheduler with but I can't get it run. I wrote a batch file that uses xcopy to back up the files and this works fine. At least it does when I click on it from the desktop. My problem is with the script that I wrote to schedule the task. The script is:
SCHTASKS /Create /SC weekly /D MON,TUE,WED,THU,FRI /TN "MyDocsBackup" /ST 14:00:00 /TR "C:\newbackup.bat" /ru Domain\Administrator /rp Password
The log files that I have checked all show that it was run successfully with an exit code(0).My login has admin rights.What am I doing wrong here?