4

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...

4

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
|improve this answer|||||
  • 1
    I tried this out, it works. you can also go in after the copy and delete the desktop.ini file manually. It's a hidden system file so you have to change your view settings. – Doltknuckle May 13 '14 at 17:49
1

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.

|improve this answer|||||
-2

Here's what I do:

robocopy %USERPROFILE%\Desktop   %DRIVE%%BACKUPFOLDERNAME%\Desktop   /COPY:DAT /A /S /FFT /R:0 /W:30 /TEE /ETA /XO /LOG:"%USERPROFILE%\Documents\backuplogs\my_desktop.txt" 
robocopy %USERPROFILE%\Favorites %DRIVE%%BACKUPFOLDERNAME%\Favorites /COPY:DAT /A /S /FFT /R:0 /W:30 /TEE /ETA /XO /LOG:"%USERPROFILE%\Documents\backuplogs\my_favorites.txt"
robocopy %USERPROFILE%\Documents %DRIVE%%BACKUPFOLDERNAME%\Documents /COPY:DAT /A /S /FFT /R:0 /W:30 /TEE /ETA /XO /LOG:"%USERPROFILE%\Documents\backuplogs\my_documents.txt"
robocopy %USERPROFILE%\Downloads %DRIVE%%BACKUPFOLDERNAME%\Downloads /COPY:DAT /A /S /FFT /R:0 /W:30 /TEE /ETA /XO /LOG:"%USERPROFILE%\Documents\backuplogs\my_dowloads.txt"
robocopy %USERPROFILE%\Music     %DRIVE%%BACKUPFOLDERNAME%\Music     /COPY:DAT /A /S /FFT /R:0 /W:30 /TEE /ETA /XO /LOG:"%USERPROFILE%\Documents\backuplogs\my_music.txt"
robocopy %USERPROFILE%\Pictures  %DRIVE%%BACKUPFOLDERNAME%\Pictures  /COPY:DAT /A /S /FFT /R:0 /W:30 /TEE /ETA /XO /LOG:"%USERPROFILE%\Documents\backuplogs\my_pictures.txt"
robocopy %USERPROFILE%\Videos    %DRIVE%%BACKUPFOLDERNAME%\Videos    /COPY:DAT /A /S /FFT /R:0 /W:30 /TEE /ETA /XO /LOG:"%USERPROFILE%\Documents\backuplogs\my_videos.txt"
|improve this answer|||||
  • While you've provided code, this answer lacks any explanation of the the code. – Jason Aller May 13 '14 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.