Solved

Robocopy script to copy only NTFS permission of Top/Root directory

Posted on 2014-01-19
6
3,105 Views
Last Modified: 2014-02-18
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
Comment
Question by:nssasikumar
6 Comments
 
LVL 6

Expert Comment

by:alexgreen312
Comment Utility
You need your /sec switch in there to copy the security structure I think
0
 
LVL 25

Expert Comment

by:Zephyr ICT
Comment Utility
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
 
LVL 24

Expert Comment

by:lionelmm
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Accepted Solution

by:
nssasikumar earned 0 total points
Comment Utility
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
 
LVL 24

Expert Comment

by:lionelmm
Comment Utility
Good thinking
0
 

Author Closing Comment

by:nssasikumar
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this guide, I outline 7 key steps to help technology professionals grow their careers. Whether you have been working in technology for 10 years or for 10 days, follow these steps to help you achieve your career goals and pursue your passions.
As a long-time IT Professional, the most important skill I have developed and consider to be my most valuable tool is Effective Troubleshooting. Step through my problem-solving procedure in this 10-step guide adapted from The Universal Troubleshooti…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now