0

How can I write the following command and document/comment each line?

robocopy ^
\\xxx.xxx.xxx.xxx\dir ^ :: source directory
\\xxx.xxx.xxx.xxx\dir ^ :: destination directory
/mir ^ :: mirror option
/s ^
/r:10 ^
/w:10 

This seems to work.

robocopy ^
\\XXX.XXX.XXX.XXX\d$\   ^%= SOURCE DIRECTORY =%
\\XXX.XXX.XXX.XXX\d$\    ^%= DESTINATION DIRECTORY =%
/mir            ^%= MIRROR SOURCE =%
/s          ^%= COPIES SUBDIRECTORIES =%
/xd         ^%= EXCLUDE DIRECTORIES =%
   "\\XXX.XXX.XXX.XXX\d$\$recycle.bin" ^
   "\\XXX.XXX.XXX.XXX\d$\System Volume Information"
/r:10           ^%= FILE RETRIES (seconds) =%
/w:10           ^%= FILE WAIT TIME (seconds) =%
/v          ^%= VERBOSE LOG =%
/log:           ^%= LOG FILE NAME =%
   "Replicate Files Server.log"
kyletme
  • 391
  • 3
  • 16
  • 2
    Does this answer your question? [Which comment style should I use in batch files?](https://stackoverflow.com/questions/12407800/which-comment-style-should-i-use-in-batch-files) Specifically, the part where inline comments are done `%= like this =%` – SomethingDark Apr 06 '22 at 03:31
  • it'll be easier in powershell, just use `#` for line comments – phuclv Apr 06 '22 at 04:11

0 Answers0