Windows 10: Robocopy copies unwanted folders

Discus and support Robocopy copies unwanted folders in Windows 10 Software and Apps to solve the problem; So, I'm working on a script that, among other things, backs up Documents folder to USB drive. The issue that I'm having is the same as this guy... Discussion in 'Windows 10 Software and Apps' started by Milan Duric, Mar 3, 2025.

  1. Robocopy copies unwanted folders


    So, I'm working on a script that, among other things, backs up Documents folder to USB drive. The issue that I'm having is the same as this guy here:---https://answers.microsoft.com/en-us/windows/forum/all/robocopy-copies-folders-not-in-documents-to-my/dd5de76d-074b-4907-952f-4693639d80f0---Meaning that robocopy copies folders that it is not told to copy.Command is:Robocopy.exe "C:\Users\$env:username\documents" "D:\$env:username\documents /e /np /teeWhat happens is that after it has copied 4 files under Documents, it starts copying Pictures, Videos and Music even though the command specifical

    :)
     
    Milan Duric, Mar 3, 2025
    #1

  2. Robocopy copies folders not in Documents to my backup Documents folder on 2nd drive.

    Two things:

    • You must surroound your folder names with double quotes:

      robocopy "C:\Users\my name\Documents . . ." "D:\Dropbox\my name\Documents
      . . ."
    • Robocopy often hides target folders, causing users to think they are missing. Look for hidden folders.
     
    Frederik Long, Mar 3, 2025
    #2
  3. Robocopy Error 2 - copyying folder in dropbox

    I have successfully created and used the following batch file in windows10

    robocopy C:\Users\Julie\Documents\Test C:\Users\Julie\Documents\accounts-backup
    pause

    However when I run the batch below to copy the contents of a folder in Dropbox I get

    ERROR 2 (0x00000002) Accessing Source Directory C:\Users\Julie\Dropbox\accounts\
    The system cannot find the file specified.

    robocopy C:\Users\Julie\Dropbox\accounts C:\Users\Julie\Documents\accounts-backup
    pause

    Any suggestions to resolve this
     
    ColinKinsella, Mar 3, 2025
    #3
  4. TWWade Win User

    Robocopy copies unwanted folders

    Robocopy copies folders not in Documents to my backup Documents folder on 2nd drive.

    I currently have 2 PCs with Windows 10 that I backup Documents, Music, Pictures, and Videos to a 3rd PC folder that is backed up to the Cloud. On my PC, the Music, Pictures and Videos folders are not under Documents. They are at the same level as Documents
    under my user name.

    I had been using SyncToy to do the copying, but had to switch to Robocopy because SyncToy does not work right under Windows 10. All works fine. The SyncToy command and then the Robocopy command run on the 3rd PC.

    I want to eliminate the 3rd PC and move the backup folder to a 2nd hard drive on my PC. That is where the problem begins. Robocopy will now run on my PC. When Robocopy copies the Document folder to the backup Documents folder, it copies 'My Music', 'My
    Pictures' and 'My Videos' to the backup Documents folder. These folders do not exist in the Documents folder. It appears that there is some link that connects 'My Music' to the separate Music folder. The same applies to 'My Pictures' and 'My Videos'.

    This is the Robocopy command that I want to use to copy the Documents data to the backup Documents folder:

    robocopy C:\Users\my name\Documents C:\Users\my name\Dropbox\PC1\Documents /mir >> c:\robocopybackup_%date:~-4,4%%date:~-10,2%%date:~-7,2%.log

    I tried adding the /XL Robocopy option to block the copy of these unwanted folders to my backup:

    robocopy C:\Users\my name\Documents D:\Dropbox\my name\Documents /XD "C:\Users\my name\Documents\My Music","C:\Users\my name\Documents\My Pictures","C:\Users\my name\Documents\My Videos" /mir >> c:\robocopybackup_%date:~-4,4%%date:~-10,2%%date:~-7,2%.log

    This did not help. Please tell me what to do.....

    Thank you!
     
    TWWade, Mar 3, 2025
    #4
Thema:

Robocopy copies unwanted folders

Loading...
  1. Robocopy copies unwanted folders - Similar Threads - Robocopy copies unwanted

  2. Robocopy copies unwanted folders

    in Windows 10 Gaming
    Robocopy copies unwanted folders: So, I'm working on a script that, among other things, backs up Documents folder to USB drive. The issue that I'm having is the same as this guy...
  3. Robocopy cannot copy files when I specify which folders to copy

    in Windows 10 Gaming
    Robocopy cannot copy files when I specify which folders to copy: https://answers.microsoft.com/en-us/windows/forum/all/why-robocopy-only-copy-directories-but-not-files/6dbeb8e7-f139-422a-aafe-19bd292c9297?page=1e-19bd292c9297?page=1I have an additional question on this thread, the consequence still doesn't make sense for me.Regard there...
  4. Robocopy cannot copy files when I specify which folders to copy

    in Windows 10 Software and Apps
    Robocopy cannot copy files when I specify which folders to copy: https://answers.microsoft.com/en-us/windows/forum/all/why-robocopy-only-copy-directories-but-not-files/6dbeb8e7-f139-422a-aafe-19bd292c9297?page=1e-19bd292c9297?page=1I have an additional question on this thread, the consequence still doesn't make sense for me.Regard there...
  5. Robocopy cannot copy files when I specify which folders to copy

    in Windows 10 Network and Sharing
    Robocopy cannot copy files when I specify which folders to copy: I have an additional question on this thread, the consequence still doesn't make sense for meRegard there are folder a b c d, inside of each folder, a' b' c' d' folder exists and inside there, there are a" b" c" d" files each.C:\folder\a\a'\a" c:\folder\b\b'\b"...
  6. Robocopy cannot copy files when I specify which folders to copy

    in Windows 10 Gaming
    Robocopy cannot copy files when I specify which folders to copy: I have an additional question on this thread, the consequence still doesn't make sense for meRegard there are folder a b c d, inside of each folder, a' b' c' d' folder exists and inside there, there are a" b" c" d" files each.C:\folder\a\a'\a" c:\folder\b\b'\b"...
  7. Need to use robocopy to copy encrypted folder/files.

    in Windows 10 Network and Sharing
    Need to use robocopy to copy encrypted folder/files.: G'day,I've made and have been using a batch file to back up my files. I was using xcopy, but I added a new folder which contains directories which are larger than the 254 character limit, so I started using robocopy. The only problem is, robocopy doesn't seem to support...
  8. Need to use robocopy to copy encrypted folder/files.

    in Windows 10 Gaming
    Need to use robocopy to copy encrypted folder/files.: G'day,I've made and have been using a batch file to back up my files. I was using xcopy, but I added a new folder which contains directories which are larger than the 254 character limit, so I started using robocopy. The only problem is, robocopy doesn't seem to support...
  9. Need to use robocopy to copy encrypted folder/files.

    in Windows 10 Software and Apps
    Need to use robocopy to copy encrypted folder/files.: G'day,I've made and have been using a batch file to back up my files. I was using xcopy, but I added a new folder which contains directories which are larger than the 254 character limit, so I started using robocopy. The only problem is, robocopy doesn't seem to support...
  10. How Robocopy copy the folder start with A?

    in Windows 10 Installation and Upgrade
    How Robocopy copy the folder start with A?: Hi Recently i want to migrate my laptop to my desktop data, and i want to do it batch by batch So it is the below command is the correct command to copy the folder name start with A robocopy C:\Users\xxx\ a*.* /S ?MIR Z:\Users\xxx\ /COPY:DT /DCOPY:T Thank You...