Overriding destination directory from ROBOCOPY Job file?

Posted by marc_s on Server Fault See other posts from Server Fault or by marc_s
Published on 2010-03-15T09:15:40Z Indexed on 2010/03/15 9:20 UTC
Read the original article Hit count: 664

Filed under:

I am using Robocopy for backing up my project directories to an external disk, and it works like a charm.

Except for one little issue: sometimes, I wish I could override the destination directory which I specify in my Robocopy Job file (myproject.rcj) to send the files somewhere else.

So if I have this in my myprojects.rcj:

:: Robocopy Job MYPROJECT.RCJ

:: Source Directory :
 /SD:d:\MyProject :: Source Directory.

:: Destination Directory :
 /DD:f:\MyDefaultDestination :: Destination Directory.

is there any way I can instruct Robocopy to use a different destination when executing it using a job?

So I execute Robocopy like this:

robocopy /job:myproject.rcj

and I wish I could override the default destination directory by using:

robocopy /job:myproject.rcj /DD:X:\OtherDestination

but that doesn't seem to work.....

ERROR : Invalid Parameter #2 : "/DD:X:\OtherDestination"

Any ideas??

© Server Fault or respective owner

Related posts about robocopy