Robocopy command to copy updated files and long path names

I think the /XN is the problem , please check this link: as we know that : /xn = Excludes newer files.

/E = Copies subdirectories. this option includes empty directories.

  • I think you need to use a different switch check :

/maxlad:Specifies the maximum last access date (excludes files unused since N).

/minlad:Specifies the minimum last access date (excludes files used since N) If N is less than 1900, N specifies the number of days. Otherwise, N specifies a date in the format YYYYMMDD.

-- for the issue of long path name , I have a solution but it will take much time , so to not consume more time any of GUI tools that solve this problem easily , try to google rsync , gsrichcopy 360 or teracopy , the good news that also these can solve the issue of the recent files or updated one , but first check my solution that I mentioned above

You can try to copy from Folder DS to Folder SR -- with the option to copy only newer files. Then copy Folder SR to Folder DS. It sounds as if there might not be too many files in Folder DS which are newer, and so this won't add much time.

And in the end, both folders would be completely up to date.

This really depends on the details of your need, but might be what you want to do.

This is a solution which you can try to apply or you can switch to robocopy alternatives which are mentioned by other users.