Sign in with
Sign up | Sign in

Problems with Robocopy Script

Tags:

ADMIN Sorry about double post but it rejected my email address for some reason. If possible can you delete duplicate message

I am having several issues with a Robocopy script. The final use will be to backup a Windows 7 Ultimate 64bit laptop to an external USB drive. I have tried using Xcopy and it seems to work OK but when I use Robocopy as suggested by Others I have two issues:-
1) The batch file will only run if I right click and select run as administrator. If I just double click The error message says "Error 5 Scanning Source Directory C:\Users\User\Documents\Music\ Access is denied" I have tried adding the user to the Backup operators Group as suggested in some forums but it wont run unless I select run as Administrator.
2) The second issue is that for one of the backup lines Robocopy creates a hidden folder on the destination and copies system files e.g Recycler and Volume information. Again I have tried various switches such as /a-:sh but it makes no difference. Even if I create the directory in advance it still makes that directory hidden. Its only the last script for backing up the D: drive that causes the hidden folder problem. I have searched various forums including Technet papers but cant find an answer. Below is the batch script. I may not have the syntax right for some things like the log file and any advice would be appreciated.

@Echo Off
COLOR fc
Echo ------------------Copying My Documents--------------------
robocopy C:\Users\User\Documents G:\Backups\Documents /e /sec
Echo ------------------Copying My Music--------------------
robocopy C:\Users\User\Music G:\Backups\Music /e /sec
Echo ------------------Copying My Pictures--------------------
robocopy C:\Users\User\Pictures G:\Backups\Pictures /e /sec
Echo ------------------Copying My Videos--------------------
robocopy C:\Users\User\Videos G:\Backups\Videos /e /sec
Echo ------------------Copying Data Drive--------------------
robocopy D:\ G:\Backups\Storage /e /sec /v > C:\Users\User\Desktop\BackupLog.txt
Echo -------------------Copy Completed----------------
!