locked
ROBOCOOPY bugin destination directopry name viewed in File Explorer RRS feed

  • Question

  • I use the command below (Win 8.1) to quasi mirror files from my C drive.  In particular, I am copying C;\Users\Joe\Downloads to D;\SaveDownloads.  The first tme the script is run, D;\SaveDownloads does not exist, and should be created by robocopy.

    The file copy proceeds as expected.  However, afterward, if I look for D;\SaveDownloads from File Explorer, it is not found.  Robocopy has created D;\Downloads instead (but only when viewed from File Explorer).

    If you open a command prompt (CMD), move to the D drive, you see D;\SaveDownloads, and it is in fact the same directory.  If you go into D;\Downloads from File Explorer and examine the properties of files under it, they shows their parents to be D;\SaveDownloads.

    So the directory is shown by one name in File Explorer and a different one from the command prompt.  Renaming it in File Explorer seems to work.  Subsequent runs of the script seem to work properly.  And if the target directory already exists, there are not problems.

    This directory anomaly is very puzzling to me, and I hate it when a system does things I cannot explain.  Leaves me little confidence i  everything.

    Here is the command;

    robocopy "C;\Users\MyUser\Downloads" "D;\SaveDownloads" /E /r;10 /w;5 /mov /np /MT;16 /log+;c;\batchfiles\robosavedownloads.log






    Sunday, July 5, 2015 9:47 PM

Answers

  • Hi,

    Actually, I tried your command firstly, it seems like there is a problem with the these parameter below in your command:

    /r;10 /w;5

    /log+;c;\batchfiles\robosavedownloads.log

    It's hard to say where the problem it is. However, the log file couldn't be created automatically, it's necessary to be exits before command running.

    When problem occurs, I checked the grammer in your command, but everthing seems like correct. Therefore, I input the command manually and it works.


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, July 8, 2015 7:54 AM

All replies

  • Hi,

    There is a problem with your command, try to use the command below for test:

    robocopy c:\Users\MyUser\Downloads D:\SaveDownloads /E /r:10 /w:5 /mov /np /mt:16 /log+:c:\batchfiles\robosavedownloads.log

    Note: Please copy and paste the command to CMD prompt. I already made a test using above command, it works with no problem in our testing environment.

    For further knowledge about Robocopy, please access to the link below for more details:

    http://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by EMMmmmmmm Tuesday, July 21, 2015 9:34 AM
    Tuesday, July 7, 2015 8:31 AM
  • OK.  The only difference between your command and the one I have been using are the double-quotes (").  I ran your version anyway, and it worked just fine.  I don't understand why this made a difference, though.

    I have other directories that I am copying, however, that have spaces in the directory names.  This means I need the double-quotes, right?

    Tuesday, July 7, 2015 5:59 PM
  • Oh, I should have mentioned, in my original post, I had to replace the colons in the command with semi-colons.  The BB software kept trying to interpret the command as a URL or something.  How do you get them in your posts?
    Tuesday, July 7, 2015 6:04 PM
  • Hi,

    Actually, I tried your command firstly, it seems like there is a problem with the these parameter below in your command:

    /r;10 /w;5

    /log+;c;\batchfiles\robosavedownloads.log

    It's hard to say where the problem it is. However, the log file couldn't be created automatically, it's necessary to be exits before command running.

    When problem occurs, I checked the grammer in your command, but everthing seems like correct. Therefore, I input the command manually and it works.


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, July 8, 2015 7:54 AM