Robocopy creates hidden directorys in win xp

By manualphobic ·
I am using robocopy to copy data from a usb drive to a network nas. When copying using a Vista machine the destination directory is normal, if using an XP machine the Destination folder is marked as system. the same options were used in both cases the only difference was the system. here is an example of the command line:
robocopy f: m:\date_name /COPY:DT /ZB /R:2 /W:1 /E /A-:RASH /XJ /ETA /V /TEE /LOG:C:\BACKUPLOGS\date_name.LOG

How can I get it to stop marking the folder as system? the nas is a synology disk station ds207.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Robocopy creates hidden directorys in Win xp

by billdehaan In reply to Robocopy creates hidden d ...

Okay, this problem report is 5 years old, but I just went through this myself and found out what's going on. Yes, it's an issue, and yes, it's a Robocopy bug.

The basic problem is that if the source directory specified is (a) the root of a drive, and (b) has subdirectories which have hidden and system attributes (which almost all root directories do), then robocopy will consider that directory to have hidden/system attributes too, and will copy those attributes over when making the copy.

How do you stop it? You really can't. There are two options to deal with it.

First, if copying from a root directory, do it in a shell script and remove the system/hidden attributes from the destination folder after the copy.

Secondly, you could only copy from subdirectories rather than the root, ie. iterate through all subdirectories and copy them one by one. Of course, you would then have to manually handle the files *in* the root directory.

I wrote a shell script to handle all this. I'd pass it on, except I wrote it in JPSoft's "Take Command" scripting language, so it's not portable, but the same thing can be done with PowerShell or other scripting languages (perl, ruby, even .BAT if you try hard enough).

Related Discussions

Related Forums