robocopy /mir changes destination folder name-how to prevent that

When I run a robocopy batch file that reads:

robocopy "C:\Users\mgo\Documents" "E:\Documents backup on the UltraBay drive" /mir

the destination folder gets renamed to "E:\My documents" WHY? How to keep that from happening? What arguments can I use to preserve the destination folder name?

This only happens when doing robocopy from a SYSTEM folder (My documents, My pictures, etc) but not when I create a non-system folder and copy the contents to a non-system destination folder that I created. Then the destination folder name does not change. Obviously, it's a Library/System folder thing...


You need to exclude desktop.ini which tells windows how to display the name of the My Documents folder. The switch /XF desktop.ini will do this.

Use the following:

robocopy "C:\Users\mgo\Documents" "E:\Documents backup on the UltraBay drive" /mir /XF desktop.ini

I believe it is because the actual directory is named "My Documents". If you go into Windows Explorer, start at C and drill down into the users directory into the users profile you will see that it is actually called "My Documents". Documents is similar to a shortcut and is not the true folder name.