Robocopy C:\Users results in an output folder larger than the entire source disk.

battleboner 0 Reputation points
2024-12-07T13:57:05.2966667+00:00

Hi all! I was directed here from the MSFT community forums, so I want to be upfront that the rest of this question is copy-pasted from my original post there. Additionally, I'm still not sure if I'm in the right place, because it asks me for tags to describe my question but 90% of the tags seem to have to do with Azure and I wasn't able to find any tags to describe my question besides "Windows 11". With that being said, I'm still trying to solve this issue, and any advice is helpful. Thank you!~

My windows 11 install on my main PC has gotten quite messy as of late, and additionally, I am split between two different Microsoft accounts on two different computers, which I'd like unified under one account. My solution for this was going to be to simply back-up the old users folders (there are three) in case I need any data from it in the future, nuke the entire install, and then reinstall - signing in under the correct account in the process.

However, I seem to repeatedly run into the same issue at the beginning of this process. I've run robocopy with several combinations of flags (including /b, /mt, /s, and more) but every time I do it, with seemingly any combination of flags, it copies what's supposed to be a 64gb folder into a source folder that, if I don't end the CMD process, seems to infinitely inflate in size - even to sizes larger than the source SSD I'm copying from (I've seen it create 250gb+ folders before I interrupted the process. The source (boot SSD) is only 120gb).

I have considered simply copy + pasting the users folder to my backup drive, however I worry about ACLs and file permissions/hidden files, and other files potentially not copying for whatever reason. Preferably I'd like everything that's there now to be copied 1:1, this way I can comfortably nuke the drive and worry later on about which files and folders are important for me to keep and which I can rid myself of. I know xcopy exists but have no experience using it. It seems equally simple to robocopy, except without multithreading it could potentially take a long time to find out if xcopy is working properly or if it's doing the same thing robocopy did. I searched the forums (and Microsoft Learn!) high and low for both the robocopy issue and for an easier way to "merge" two user accounts under one Microsoft account umbrella, but learned it simply isn't possible the way I need it done. I'm not technically illiterate, I like to think I can find my way around Windows pretty well, but this one has had me stumped for a week now. Does anyone have a solution for what I'm trying to accomplish? Or at least any advice or recommendations to make any of the steps of this process simpler. Thank you so much!

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 36,291 Reputation points
    2024-12-07T17:21:40.7+00:00

    Try running robocopy with the /xj switch.

       /XJ :: eXclude symbolic links (for both files and directories) and Junction points.
       /XJD :: eXclude symbolic links for Directories and Junction points.
       /XJF :: eXclude symbolic links for Files.
    

    For whatever reason, years ago, someone at Microsoft chose to create a junction for "Application Data" that points back to itself.

    C:\>dir /a c:\users\admin\AppData\Local\
     Volume in drive C is OS
     Volume Serial Number is 36C0-6121
     Directory of c:\users\admin\AppData\Local
    12/05/2024  10:37 AM    <DIR>          .
    12/05/2024  10:37 AM    <DIR>          ..
    12/04/2024  10:43 PM    <JUNCTION>     Application Data [C:\Users\admin\AppData\Local]
    12/04/2024  10:43 PM    <JUNCTION>     History [C:\Users\admin\AppData\Local\Microsoft\Windows\History]
    12/05/2024  10:37 AM    <DIR>          Microsoft
    06/06/2022  08:28 AM    <DIR>          Microsoft_Corporation
    04/01/2024  02:26 AM    <DIR>          Temp
    12/04/2024  10:43 PM    <JUNCTION>     Temporary Internet Files [C:\Users\admin\AppData\Local\Microsoft\Windows\INetCache]
                   0 File(s)              0 bytes
                   8 Dir(s)  452,027,797,504 bytes free
    

    When you tell robocopy to copy all subfolders, it goes into a recursive loop processing that folder.

    C:\>robocopy c:\users\admin c:temp\admin /e /l
    -------------------------------------------------------------------------------
       ROBOCOPY     ::     Robust File Copy for Windows
    -------------------------------------------------------------------------------
      Started : Saturday, December 7, 2024 11:22:44 AM
       Source : c:\users\admin\
         Dest : C:\temp\admin\
        Files : *.*
      Options : *.* /L /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30
    ------------------------------------------------------------------------------
              New Dir          6    c:\users\admin\
                New File              262144        NTUSER.DAT
                New File              114688        ntuser.dat.LOG1
                New File                   0        ntuser.dat.LOG2
                New File               65536        NTUSER.DAT{2ad838bc-efea-11ee-a54d-000d3a94eaa1}.TM.blf
                New File              524288        NTUSER.DAT{2ad838bc-efea-11ee-a54d-000d3a94eaa1}.TMContainer00000000000000000001.regtrans-ms
                New File              524288        NTUSER.DAT{2ad838bc-efea-11ee-a54d-000d3a94eaa1}.TMContainer00000000000000000002.regtrans-ms
              New Dir          0    c:\users\admin\AppData\
              New Dir          0    c:\users\admin\AppData\Local\
              New Dir          0    c:\users\admin\AppData\Local\Application Data\
              New Dir          0    c:\users\admin\AppData\Local\Application Data\Application Data\
              New Dir          0    c:\users\admin\AppData\Local\Application Data\Application Data\Application Data\
              New Dir          0    c:\users\admin\AppData\Local\Application Data\Application Data\Application Data\Application Data\
              New Dir          0    c:\users\admin\AppData\Local\Application Data\Application Data\Application Data\Application Data\Application Data\
              New Dir          0    c:\users\admin\AppData\Local\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\
      
    
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.