robocopy /mov help

John JY 221 Reputation points


The files older than 12/31/2020 are needed to move the other share(windows 2012). I tried to use
robocopy souce destination /mov /minage:63 /zb /mir /mt /r:5 /w:5

the files security and ownerships are needed to keep on the destination.

Can the above command keep files security and ownership?

Thank you for your help!

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,575 questions
{count} votes

Accepted answer
  1. MotoX80 32,726 Reputation points

    The /mir (mirror) switch conflicts with the /mov (move) switch. Try this instead.

    robocopy C:\Temp\src C:\Temp\dest /mov /e /minage:63 /zb /COPY:DATSO  /r:5 /w:5 /l

    The /l switch will perform a "whatif" operation and show you what it would move, but not actually do a copy.

    /e will tell robocopy to process subfolders.

    Pick one subfolder and test with that first. Run it initially with the /l and review the output. Then run it without /l and verify that the files you expected to be moved were in fact moved and that the permissions look correct.

    Permission inheritance on the destination folders may affect the final permissions.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. John JY 221 Reputation points

    somehow, it does not accept storage UNC paths. Can anyone help with powershell script to do the same? Thank you!