Per TechSoEasy's link in another thread, I believe this should work:
http://cwashington.netreac
Main Topics
Browse All TopicsHi all,
I currently have a roaming profile directory that contains 700 or so folders I (as a domain admin) don't have access to. The ownership is incorrect. This occured whilst changing from an NT domain to 2003.
I now need to move these files to a new server. Although I can replace the ownership on all folders it revokes the permissions the user had. I don't want to have to grant Domain Users full access to all folders to solve this issue. I would like to be able to script something that would set the permissions on each folder like so;
Example 1
Folder name: JBloggs
Permmissions: Administrators (Servername\Administrators
JBloggs - Full Control (This folder, subfolders and files)
System - Full Control (This folder, subfolders and files)
Example 2
Folder name: JSmith
Permmissions: Administrators (Servername\Administrators
JSmith - Full Control (This folder, subfolders and files)
System - Full Control (This folder, subfolders and files)
I understand I can use Cacls to change the permissions in DOS, just don't know how to get it to process each folder individually and look at the folder name as a variable. If this is even possible.
Would just be nice not to have to do it all manually?
Thanks,
Neil
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Per TechSoEasy's link in another thread, I believe this should work:
http://cwashington.netreac
This is a solution:
write batch file, and insert such three lines:
batch should be run from folder that have folders for which u want o change permissions,
FOR /D %%A IN (*) DO CACLS %%A /T /C /E /G DomainName\%%A:F
FOR /D %%A IN (*) DO CACLS %%A /T /C /E /G Servername\Administrators:
FOR /D %%A IN (*) DO CACLS %%A /T /C /E /G system:F
Regard
Larsen
Business Accounts
Answer for Membership
by: skca54Posted on 2006-12-13 at 05:44:03ID: 18130297
You would need to create a batch file. I have used an excel spreadsheet (with formulas) and imported a directory listing and then copied out the result to a batch file. The batch file can then be run.
Copy you directory to a text file: d'r /b >>dirs.txt'
import the 'dirs.txt' file into a column in excel
in another column create a formula for the cacls command line including the directory name and replicate down the column
copy the resulting column to a text file with 'cmd' extension
Does this help.
If you want I will try and explain it a bit better.