Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9702

Can I use Robocopy to move all files, directories and subdirectories and preserve all creation and modified timestamps?

$
0
0

I am trying to move all files and directories and subdirectories including empty ones while preserving both creation and modified timestamps. I tried robocopy but it seems no matter what parameter I use, with /mov or /move some subfolder modified dates will not be preserved (any subfolder which is not empty).

what I ran to test:

robocopy C:\Users\Name\Desktop\test\source\ C:\Users\Name\Desktop\test\dest /mt /move /e /r:10 /COPY:DAT /DCOPY:DAT

test setup:

test\dest\test\source\file 1.txttest\source\file2.txttest\source\folder1\subfolder 1\text.txttest\source\folder1\subfolder 2\test\source\folder2\

note that subfolder 1 gets a modified date at which the file it contains was moved. I guess this happens because robocopy handles the contents after it created the folder, but it doesn't come back to correct the modified date once all content has been copied into the subfolder.

how can I do this move while preserving all creation and modification datetimes on all folders subfolders and files?


Viewing all articles
Browse latest Browse all 9702

Trending Articles