r/PowerShell • u/Radiant-Photograph46 • Jan 21 '26
Question Copy a folder attributes / copy a folder without content
I want to copy a folder's attributes to another folder (hidden flag, creation date etc.) or simply copy the folder itself without any of its content. I'm not finding any solution for this, can you help?
I thought robocopy would be good for that but it doesn't copy the root. I mean that robocopy C:\Source C:\Dest will not create the C:\Dest folder. But I might have missed something there. Thank you.
8
Upvotes
2
u/purplemonkeymad Jan 21 '26
Make sure that you include those attributes in your robocopy setting. /COPYALL will include data too but you can specify each item individuality using /COPY:DATSOU and just omit the ones you don't want. (so to exclude data you want /COPY:ATSOU)
2
u/skilife1 Jan 21 '26
This is what I use to replicate a folder structure beneath a new starting folder.
0
u/[deleted] Jan 21 '26
[deleted] — view deleted comment