locked
Robocopy creating destination directory RRS feed

  • Question

  • When I am executing robocopy to copy the files to network drive. If folder name spelt wrong, it is not there it is trying to create the fodler with wrong spelt name. Can we prevent not to create non existing directories?
    • Moved by Bill_Stewart Friday, September 4, 2015 8:42 PM Move to more appropriate forum (this is not a robocopy support forum)
    Friday, September 4, 2015 8:41 PM

Answers

  • Do not believe this is possible with robocopy itself. However,

    You could test for if each folder exists then run the robocopy command if it does, and not if it does not. This is the IF command.

    IF EXIST C:\users (Echo Folder Exists) ELSE (Echo Failed)

    You could combine that with a FOR folders command but the starts to get complex if you want to compare it with a folder on different volume and if that exists. That is beyond a general Windows 10 question. You could post it somewhere else, I find a lot of results on the http://stackoverflow.com/ forum when I search for command prompt stuff so it that may be worth a look.

    Saturday, September 5, 2015 11:51 AM

All replies

  • How to move?
    Friday, September 4, 2015 9:06 PM
  • Do not believe this is possible with robocopy itself. However,

    You could test for if each folder exists then run the robocopy command if it does, and not if it does not. This is the IF command.

    IF EXIST C:\users (Echo Folder Exists) ELSE (Echo Failed)

    You could combine that with a FOR folders command but the starts to get complex if you want to compare it with a folder on different volume and if that exists. That is beyond a general Windows 10 question. You could post it somewhere else, I find a lot of results on the http://stackoverflow.com/ forum when I search for command prompt stuff so it that may be worth a look.

    Saturday, September 5, 2015 11:51 AM