Having Trouble Writing Batch Script That Mirrors Folder to Nas Drive

I've been looking throughout the forum to find an answer and nothing. I just want to copy files from my desktop folder to my NAS drive. I wrote this script below and I got an error "You do not have the Manage Auditing user right.***** You need this to copy auditing information (/COPY:U or /COPYALL)" Any ideas why this wouldn't work or what the error means?

@ECHO OFF
SETLOCAL
SET _Source=C:\Users\desktop\folder
SET _dest=\\NASdrive\share\folder
SET _what=/COPYALL
SET _ options=/R:0 /W:0 /MIR /LOG:log.txt
ROBOCOPY %_source% %_dest% %_what% %_options%

2 Answers

You have a space between _ and options. Removing this space made the code work fine for me.

This link might have an explanation - Robocopy /copyall

Says:

This thing with robocopy /copyall is that the first thing it does it change the permissions on the destination folder that you are copying into.

I'm guessing your NAS doesn't appreciate robocopy changing permissions.

COPYALL is equivalent to /COPY:DATSOU

/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).
                     (copyflags : D=Data, A=Attributes, T=Timestamps).
                     (S=Security=NTFS ACLs, O=Owner info, U=aUditing info)

So you are telling Robocopy to set Attributes, ACLs, Owner, and Auditing Info on the destination drive. Since this is a NAS (and assuming not Windows) I don't think Robocopy can do this.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest