Copy NTFS permissions from 1 folder to another

I have a folder that holds each of my user's data (%usernam%). I want to copy thos NTFS permissions as well as ownership of folders to another folder that has the same users but different data. Here is the example:

Folder A\%username%
copy all NTFS permissions including folder ownership to:
Folder B\%username%

What is the best way to go about doing this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robocopy has this ability, to preserve NTFS permissions when copying.
It's part of the resource kit

Something like this:
robocopy source destination /COPYALL
lenivanAuthor Commented:
To be clear...

I DO NOT want the copy the folder or its contents. I only want to copy the permissions. Will robocopy still work?
Madison PerkinsConsultantCommented:
get the server 2003 resource kit and use xcopy.exe in conjunction with permcopy.exe.  use xcopy /? and permcopy /? to get the proper command line switches.  with these two tools you can do excactly what you want.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Madison PerkinsConsultantCommented:
hmmm.  just read your reply.  so you want to read the ntfs permissions from one folder and apply those ntfs permissions to another folder that already exists.  I know how to apply specific ntfs permissions to a folder with a script but not sure about reading them.  
Madison PerkinsConsultantCommented:
it may take a little time to get running but this might work.
Madison PerkinsConsultantCommented:
here is a GUI for xcalcs.vbs script.  I am testing your senario right now.
I don't believe robocopy will do what you want.  Sorry about the confusion.
Madison PerkinsConsultantCommented:
xcalcs will read and display the ntfs permissions of a folder.  you can then use xcalcs to edit/grant/deny/replace the permissions as well as ownership of files and/or folders contained within another folder.  I was able to do what you are looking for from the command line with xcalcs.vbs.  the gui worked for everything but the ownership portion.  

I was not able to find something that will look at one folder, read the rights then apply it to another folder.  it is possible and there may be an app out there that will but i was unable to find it.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lenivanAuthor Commented:
madperk, so I am unable to copy ownership info from 1 folder and apply it to another?
Setacl (sourceforge project)  is able to do that.

I just tested it successfully. From subfolder 1 to another subfolder 2 somewhere else

setacl -on "Folder1\Subfolder1" -ot file -actn list -lst "f:sddl;w:d,o" -bckp "E:\Listing.txt"

Then edit the listing.txt   "Folder1\Subfolder1" -->   "Folder2\Subfolder2"

and :

setacl -on "folder2\Subfolder2" -ot file -actn restore -bckp "E:\Listing.txt"

Your done...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.