question about robocopy behavior...


  1. Posts : 15
    Windows 10 Pro
       #1

    question about robocopy behavior...


    I was trying to do a quick backup of my documents folder, so decided to use robocopy with the /MIR switch:

    robocopy C:\Users\Brian\Documents D:\Backups\X390\Current\Documents /MIR

    It was taking a really long time, and what I discovered is that robocopy also backed up my pictures and video folders, as "My Pictures" and "My Videos" as subfolders of "Documents."

    Since the pictures folder (and all others) are separate folders at C:\Users\Brian\Pictures, etc., why is robocopy seeing them as subfolders of "Documents?"

    I played around with it a little bit, but didn't come up with a way to only get "Documents"--is there a way to do this?
      My Computer


  2. Posts : 1,614
    Windows 10 Home
       #2

    My wild guess is this is a Library and/or Junction[s] situation; I will listen in and learn alongside you from the wisdom of others.
      My Computer


  3. Posts : 15
    Windows 10 Pro
    Thread Starter
       #3

    RolandJS said:
    My wild guess is this is a Library and/or Junction[s] situation; I will listen in and learn alongside you from the wisdom of others.
    I thought the same about libraries, but they all appear to be separate (documents, music, pictures, videos--I left "My Music" out of my previous post). But, yes, it is like all the libraries are included, but as subfolders of Documents makes no sense.
      My Computer


  4. Posts : 24,631
    10 Home x64 (21H2) (10 Pro on 2nd pc)
       #4

    couver said:
    ... I discovered is that robocopy also backed up my pictures and video folders, as "My Pictures" and "My Videos" as subfolders of "Documents."

    @RolandJS is absolutely correct. 'My Music', 'My Pictures' and 'My Videos' are junctions, and RoboCopy will copy them as if they are folders.

    The way to tell RoboCopy to ignore junctions is to add the /XJD switch to your command line. Type RoboCopy /? for more details.


    question about robocopy behavior...-image.png
      My Computers


  5. Posts : 15
    Windows 10 Pro
    Thread Starter
       #5

    Bree said:
    @RolandJS is absolutely correct. 'My Music', 'My Pictures' and 'My Videos' are junctions, and RoboCopy will copy them as if they are folders.

    The way to tell RoboCopy to ignore junctions is to add the /XJD switch to your command line. Type RoboCopy /? for more details.


    question about robocopy behavior...-image.png
    Well, bingo! I've been using Windows basically since it began, and never heard of "Junctions." I Googled it, and still don't really get it, or why it is there, but I was able to reproduce your screen shot of the command prompt showing those folders as Junctions. I added the /XJD switch after /MIR, and sure enough, just a very quick update of my Documents folder backup.

    Thank you!
      My Computer


  6. Posts : 24,631
    10 Home x64 (21H2) (10 Pro on 2nd pc)
       #6

    couver said:
    Well, bingo! I've been using Windows basically since it began, and never heard of "Junctions." I Googled it, and still don't really get it, or why it is there...
    Those junctions have been there since (I think) Vista - they're certainly there in Win7 and above. A junction is a hard link that makes a folder appear to be somewhere, when in actual fact it's located elsewhere.

    Their purpose is to support older programs written for XP or earlier, when 'My Music' and the others were the real location of these folders. There are others, for example a 'Documents and Settings' junction at the root of the C:\ drive. That one points to C:\Users, the junction name is the folder where XP kept its user folders.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 10:36.
Find Us




Windows 10 Forums