1

I tried this on command line and it will work correctly

robocopy /mir /copy:DAT /mot:30  "D:\Source File\file" "E:\Target Directory\backup %DATE:/=-% %time::=-%" /xd "D:\Source File\file\excluded"

But after I create a schedule task to run it, I got 0x10 result

It will just run correctly if I remove this part

%DATE:/=-% %time::=-%

Any suggestion, will help me a lot.

thanks

zer09
  • 113
  • 4

1 Answers1

0

I don't think robocopy would understand how to translate the variable %DATE:/=-% or %time::=-% natively. Try changing your scheduled task to run cmd and call robocopy from there.

cmd /c robocopy /mir /copy:DAT /mot:30  "D:\Source File\file" "E:\Target Directory\backup %DATE:/=-% %time::=-%" /xd "D:\Source File\file\excluded"
Nixphoe
  • 4,524
  • 7
  • 32
  • 51