+ Post New Thread
Results 1 to 2 of 2
Windows Server 2000/2003 Thread, Inherit Permissions setting via cmd in Technical; Hi, I've come in this morning and realised that some changes i made over the holiday haven't worked quite as ...
  1. #1
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    255
    Thank Post
    43
    Thanked 58 Times in 39 Posts
    Rep Power
    22

    Inherit Permissions setting via cmd

    Hi,
    I've come in this morning and realised that some changes i made over the holiday haven't worked quite as i hoped. I now need a way to take ownership of files and folders, then set them to inherit their permissions from above.
    I've figured out how to take ownership with the takeown command, but can't find a way to set the inherit permissions setting on them without doing it manually! Is there a command i can run that will set this? I really don't want to have to do it manually!?!

    I will need to script this so that it does it for every user, but only certain folders are affected.... (Application Data, Desktop)

    Anyone know how i can do this?
    Thanks

  2. #2
    bmdixon's Avatar
    Join Date
    Apr 2008
    Location
    Birmingham
    Posts
    255
    Thank Post
    43
    Thanked 58 Times in 39 Posts
    Rep Power
    22

    SOLVED :)

    I figured it out
    I used
    Code:
    takeown /F * /R
    to take ownership of the folders/files
    then
    Code:
    xcacls.vbs "Application Data" /I Enable /T
    to set the inherit setting.

    Code:
    @echo off
    for /F %%g IN (test.txt) DO (
    cd %%g\
    @echo Doing %%g
    takeown /F * /R
    @echo Owned %%g
    xcacls.vbs "Application Data" /I Enable /T /F
    @echo Done %%g
    cd ..)
    test.txt contained all the staff usernames, and it was the Application Data folder that needed modifying.
    It also echoes the progress at various stages.

    It's probably not perfect but it worked
    Last edited by bmdixon; 20th April 2009 at 01:26 PM. Reason: missed option from xcacls

SHARE:
+ Post New Thread

Similar Threads

  1. Setting permissions with Group Policy
    By cookie_monster in forum Windows
    Replies: 11
    Last Post: 28th May 2010, 11:53 AM
  2. Problems setting folder permissions in GP
    By TheWhiteWiltord in forum Windows
    Replies: 3
    Last Post: 27th January 2009, 12:42 PM
  3. Replies: 5
    Last Post: 17th October 2008, 03:34 PM
  4. Mass setting NTFS permissions
    By localzuk in forum Windows
    Replies: 7
    Last Post: 8th January 2007, 04:23 PM
  5. Replies: 4
    Last Post: 23rd November 2006, 09:33 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •