Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3991
  • Last Modified:

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:\CopyOnlyNTFSRootDir.txt
0
nssasikumar
Asked:
nssasikumar
1 Solution
 
Alex Green3rd Line Server SupportCommented:
You need your /sec switch in there to copy the security structure I think
0
 
Zephyr ICTCloud ArchitectCommented:
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...
0
 
Lionel MMSmall Business IT ConsultantCommented:
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:\CopyOnlyNTFSRootDir.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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
nssasikumarAuthor Commented:
The Following script worked for me:

ROBOCOPY C:\RTest\source Y:\RTest\source /ZB /E /LEV:0 /COPY:SOU /XF *.* /XD *.* /R:10 /W:5 /log+:C:\CopyOnlyNTFSRootDir.txt
0
 
Lionel MMSmall Business IT ConsultantCommented:
Good thinking
0
 
nssasikumarAuthor Commented:
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.
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now