Friday, December 18, 2009

Robocopy Error 123 Scanning Destination Directory The filename, directory name, or volume label syntax is incorrect.

Ok. Everytime my script ran fine. One time I opened it and thought of adding some parameters and closed the script. I got an error 123 saying the destination G:\BackupFolder\ could not be found.

This was what I was using to copy some of the backup data over to a different location from a share in NAS.

robocopy \\naslocation\SharedFolder G:\BackupFolder /E /Z /COPYALL /R:3 /W:10 LOG+:G:\LogNASbkprbcpy.txt /NP

Looking at the script above can you figure out the flaw? Its darn simple actually though I had to rewrite it again because I overlooked something. Here's a correct script:

robocopy \\naslocation\SharedFolder G:\BackupFolder /E /Z /COPYALL /R:3 /W:10 /LOG+:G:\LogNASbkprbcpy.txt /NP

Hope you can figure the difference now. Its the "/" before the LOG parameter. It was missing in the previous script which got robocopy to think it was a part of destination parameter as well.

Lessons learnt: Be humble enough to consult help "robocopy /?" and match the syntax. Get proper sleep.

3 comments:

  1. Thank you, thank you. You helped me filter past looking only at the path and look at the command line switches. I was missing a '/' before /R on one of my lines. It was driving me crazy because the path looked correct and the file name looked correct and I could not figure out what was wrong. And I never even saw the missing '/' even though many of the other lines above it have the '/'.

    ReplyDelete
  2. Solved my issue too, thanks :-)

    ReplyDelete