Share via


Robocopy creating destination directory

Question

Friday, September 4, 2015 8:41 PM

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?

All replies (2)

Saturday, September 5, 2015 11:51 AM âś…Answered

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.


Friday, September 4, 2015 9:06 PM

How to move?