Robocopy created hidden directory at destination

backuppowershellrobocopy

I can't see the directory "Backup" in Windows Explorer, although I can navigate to it. The same is true for PowerShell. When I go to the root of the directory Dad and type ls I don't see it in the list. I can however cd to Backup, as shown in the screenshot.

How can I make the directory Backup visible? I have Hidden Items checked, but it's still invisible! I've never experienced this before. All the files and subdirectories copied over as expected, but they are hidden on the E drive.

The directory was created via a mirror of my D drive:

Robocopy D:\ "E:\Dad\Backup" /MIR /FFT /Z /XA:H /W:5

Hidden "Backup" Directory

Best Answer

The directory was created via a mirror of my d drive: Robocopy D:\ "E:\Dad\Backup" /MIR /FFT /Z /XA:H /W:5

It’s been a while since I’ve dealt with this and don’t remember the exact solution I used. But it appears you’re running in to the same issue with Robocopy.

If you copy from a root directory, like D:\ the destination folder will be marked with a hidden and system attribute.

After the operation you can solve this with: attrib -s -h E:\Dad\Backup

Before the operation, you can prevent this by adding the /A-:SH switch to the robocopy command line: Robocopy D:\ "E:\Dad\Backup" /MIR /FFT /Z /XA:H /W:5 /A-:SH

Additionally, if you want to see these folders, you can turn on the option to show hidden files AND to not hide special operating system folders. Or use the dir /a command.

Related Question