Which robocopy switch mirrors a directory tree, copying files and purging extras at the destination?

/mir mirrors a directory tree, equal to /e plus /purge.

Start playing free

  1. /mir ✔
  2. /lev:1
  3. /s

Why: A mirror makes the destination match the source. That includes deleting files at the destination that no longer exist at the source, so use it carefully.

Huh, didn't know that: robocopy /lev:n copies only the top n levels of the source directory tree.

The dad joke
A programmer's wife says: go to the store and buy a gallon of milk, and if they have eggs, get a dozen. He comes back with 12 gallons of milk.
Like this card?
Play the game

References

Answer: /mir. A mirror makes the destination match the source. That includes deleting files at the destination that no longer exist at the source, so use it carefully.

  1. robocopy command reference, Microsoft Learn learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
    /mir Mirrors a directory tree (equivalent to /e plus /purge ).
    Checked 2026-10-10.

Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.

Test yourself in the game