Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I thought I would try out RoboCopy for mirroring the contents of a folder to another harddrive. And seems like it worked. But, for some reason, to see the destination folder I have to both enable Show hidden files, folders and drives and disable Hide protected operating system files. Why is this? Both the source and destination folder was initially both visible and normal directories. When I open up the properties for that destination folder, the Hidden attribute is even disabled. What is going on here?

Is it because I ran it in an administrator command prompt? Or is it an issue with my choice of modifiers? Or does robocopy really just work this way?

robocopy E: I:\E /COPYALL /E /R:0 /MIR /B /ETA


Update: Tried to copy another drive to another folder, and I got the same thing happening there. But when I try to just copy a folder to a different folder, then the destination folder stays normal. Could it be because I copy a drive? If so, how can I prevent this from happening? Cause I really do want to copy the whole drive...

share|improve this question

4 Answers 4

up vote 3 down vote accepted

On my system (Vista), powershell shows the c:\ drive as having both hidden and system attributes set.

    PS C:\Users\michael.DOMAIN> Get-Item c:\


    Directory:


Mode           LastWriteTime       Length Name
----           -------------       ------ ----
d--hs     8/18/2009 12:19 PM        <DIR> C:\

After copying the files, you can use attrib to fix them. Check out attrib /? for details.

share|improve this answer
    
Hm, yeah, all my three hard drives have those attributes as well... Weird thing is that my D and E drives got a hidden system folder when I robocopied them to folders on an external drive, while the C drive didn't O.o I don't get this... –  Svish Aug 18 '09 at 18:02
    
I'm having the same problem with a hidden network share ($). I ran Get-Item on that share and it also says d--hs so I guess that's the reason! Thanks! –  Chris Haas Jan 4 '12 at 15:58
    
This can also be true of network shares in general, such as from our Synology NAS box, that marks \\nas\sharename as a hidden folder. When you copy that folder with robocopy with the /copyall or /COPY:xAxxxx that includes (A)ttributes the destination folder is created with the same attributes as the source. –  BeowulfNode42 May 12 at 0:12

I have also ran into this problem. It seems like this hidden folder comes up when the source directory is a root of the drive, eg. D:\ or F:\. These folders will contain the system and hidden attributes, and being a source root folder, it can't be removed by the attrib -s -h command.

In this example, F:\ is the source G:\ is the destination.

You can see the attributes in PowerShell. You'll see the mode d--hs for directory, hidden & system. Try the get-item command C:\> Get-Item F:\

Robocopy supposedly will not create it as a hidden folder if the folder exists. I've read on a few posts that using a /CREATE will do the trick, or you can create the folders manually ahead of time. I have to do further testing as well as other combinations to verify this fully.

Otherwise, you can do a attrib -h -s G:\Destination_Folder to remove the system and hidden attribute after the copy.

share|improve this answer

It has to do with copying the hidden/system System Volume Information from the root of a disk - if it gets copied, the target directory gets the same attributes system/hidden.

Creating the directory before copying does not help as robocopy will hide it too.

Add the /A-:SH switch to ignore system files.

More information in this Microsoft Technet discussion.

share|improve this answer

Use M Aguilar's solution if you don't mind running attrib afterwards. Another solution would be to just create the target directory beforehand:

  1. mkdir I:\E
  2. robocopy E: I:\E /COPYALL /E /R:0 /MIR /B /ETA
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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