Forum Thread

Copy folder with hidden attribute

jnetty99 52 14 September 22, 2016 at 07:21 PM
Windows question
How can I copy a folder or multiple folders that within have a hidden folder and make it stay hidden?

Everytime I copy the a folder the hidden folder within is no longer hidden and I have to re-hide it manually.

5 Comments

1

Sign up for a Slickdeals account to remove this ad.

#2
If you copy a hidden folder it stays hidden.

If you copy a non-hidden folder from a hidden parent folder it isn't hidden.


To retain a hidden attribute in the case you describe, you need to recursively apply the hidden attribute to all the sub folders and files. If you do this, you'll most likely be setting your computer to show hidden files so it doesn't accomplish that much.
Reply Helpful Comment? 0 0
Why do conservative politicians oppose conservation?
Have you ever stopped to think the long-term GOP immigration policy might be to make the United States of America a less desirable place to live than Mexico?

"If you tell a lie big enough and keep repeating it, people will eventually come to believe it" -Joseph Goebbels
Joined Aug 2011
L2: Beginner
52 Posts
14 Reputation
Original Poster
#3
Quote from jkee View Post :
If you copy a hidden folder it stays hidden.

If you copy a non-hidden folder from a hidden parent folder it isn't hidden.


To retain a hidden attribute in the case you describe, you need to recursively apply the hidden attribute to all the sub folders and files. If you do this, you'll most likely be setting your computer to show hidden files so it doesn't accomplish that much.
Any third party program that could do this or command prompt? Have about 100 folders each with a hidden folder only with each one.
Reply Helpful Comment? 0 0
#4
You can use attrib +h from the command line.

Windows can also do it directly. Un-hide the parent folder then re-hide it and you'll get a prompt offering to apply it to all sub folders and files.
Reply Helpful Comment? 0 0
#5
Try using xcopy from admin command prompt. https://support.microsoft.com/en-us/kb/323007

You can use the Xcopy command with the /O/X/E/H/K switches to copy the files and retain the existing permissions that have been specifically applied to the file or files.

These switches have the following effects:
/E - Copies folders and subfolders, including empty ones.
/H - Copies hidden and system files also.
/K - Copies attributes. Typically, Xcopy resets read-only attributes.
/O - Copies file ownership and ACL information
/X - Copies file audit settings (implies /O).
Reply Helpful Comment? 0 0
Joined Aug 2011
L2: Beginner
52 Posts
14 Reputation
Original Poster
#6
Robocopy seems to work

ROBOCOPY \\sourceserver\share \\destinationserver\share /MIR
Reply Helpful Comment? 0 0
Page 1 of 1
1
Join the Conversation
Add a Comment
 
Copyright 1999 - 2016. Slickdeals, LLC. All Rights Reserved. Copyright / Infringement Policy  •  Privacy Policy  •  Terms of Service  •  Acceptable Use Policy (Rules)  •  Interest-Based Ads
Link Copied to Clipboard