1

I'm copying with robocopy the folder C:\users to D:\Backups with the following command:

robocopy "C:\users" "D:\Backups" /e /b /copyall /MT:32 /r:0 /w:0

Instead of copying the folder content from c:\users into D:\Backups it creates a folder users and copies the content into this folder. Result: D:\Backups\Users

How can I avoid this behaviour and get the folders and the files directly into D:\Backups

someone
  • 33
  • robocopy is a DIRECTORY ORIENTED util. you give it the source dir & the target dir ... and it copies the 1st to the 2nd. if you want to copy ONLY the specific user dirs ... you will need to specify those as the source[s]. – Lee_Dailey Nov 12 '21 at 17:24
  • @Lee_Dailey I'm aware of that. Also I do not want to copy specific user dirs. The problem is that the command I wrote creates a subfolder. Instead of placing the content from C:\Users in D:\Backups it creates a subfolder D:\Backups\Users. I have worked a lot with robocopy and this behaviour is unique to the userprofile-Folder. – someone Dec 18 '23 at 13:05

1 Answers1

0

Just add the /XF-Switch and exclude desktop.ini then this will not happen.

robocopy "C:\users" "D:\Backups" /e /b /copyall /MT:32 /r:0 /w:0 /XF desktop.ini

someone
  • 33