nssasikumar
asked on
Robocopy script to copy only NTFS permission of Top/Root directory
Hi,
Need Robocopy script to copy only NTFS permission of Top/Root directory, should exclude all Sub directories and Files under Top/Root directory.
The following script doesn't work as expected:
ROBOCOPY C:\RTest\source Y:\RTest\source /ZB /LEV:0 /COPY:SOU /XF *.* /R:10 /W:5 /log+:C:\CopyOnlyNTFSRootD ir.txt
Need Robocopy script to copy only NTFS permission of Top/Root directory, should exclude all Sub directories and Files under Top/Root directory.
The following script doesn't work as expected:
ROBOCOPY C:\RTest\source Y:\RTest\source /ZB /LEV:0 /COPY:SOU /XF *.* /R:10 /W:5 /log+:C:\CopyOnlyNTFSRootD
You need your /sec switch in there to copy the security structure I think
If Robocopy doesn't work you could take a look at icacls? http://technet.microsoft.com/en-us/library/cc753525.aspx
You can backup the NTFS rights from one directory and restore them on the new directory...
You can backup the NTFS rights from one directory and restore them on the new directory...
The command as you have it now (ROBOCOPY C:\RTest\source Y:\RTest\source /ZB /LEV:0 /COPY:SOU /XF *.* /R:10 /W:5 /log+:C:\CopyOnlyNTFSRootD ir.txt ) will not copy any files or subdirectories. If you want to copy the NTFS permissions of the source folder to the destination folder it must be set to copy something. Will it work if we let it copy the files in the source and then delete them afterwards?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Good thinking
ASKER
The Script Copies only NTFS Permission for Specified folder e.g Source in our Example. Does not copy any Data, Also the Permission for Sub directories/Files are not copied.