1

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??

marc_s
  • 1,132
  • 4
  • 21
  • 35
  • Do you need this to use just the .rcj options? You could always make a .bat that takes an argument for `$destinationDIR` and passes it to robocopy. – Nathan V Nov 29 '12 at 05:55

1 Answers1

0

I was able to do this with the /LOG parameter by simply removing it from the job file. I didn't try it with /SD and /DD, but I'd be willing to throw a fish back that it'd work.

InteXX
  • 713
  • 13
  • 31
  • I confirm that @InteXX is right. If you remove the /SD and /DD sections from the job file you will be able to specify them on the command line, which means you can change any of them according to your heart's desire. Of course, this means that you will always need to specify the source and the destination on the command line, instead of the job file. – Fara Importanta Nov 03 '16 at 15:03