+ Reply to Thread
Results 1 to 7 of 7

Thread: CACLS Command - Access Denied

  Share/Bookmark
  1. #1

    Reputation

    Join Date
    Sep 2009
    Posts
    28
    Thank Post
    15
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default CACLS Command - Access Denied

    Hi,

    I am trying to use the CACLS.exe command to modify ACL's in my user directory. When I run the command it lists the directories, but, comes up after with access denied.

    Heres my script...

    cacls "D:\Userdata" /t /e /g "Administrators":F

    obviously replacing "d:\userdata" with the user data directory

    Any Ideas?!

  2. #2

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    jinnantonnix's Avatar
    Join Date
    Nov 2007
    Location
    Wales
    Posts
    1,443
    Blog Entries
    7
    Thank Post
    44
    Thanked 211 Times in 174 Posts
    Rep Power
    55

    Default

    Looks like you need to take ownership of the files.

    I'm at home on Linux, so I can't try anything, but I think you should take a look at ICACLS with the /setowner option.

    ICACLS is like CACLS on steroids.

    Icacls

  3. Thanks to jinnantonnix from:

    rjones (24-11-2009)

  4. #3

    Reputation

    Join Date
    Sep 2009
    Posts
    28
    Thank Post
    15
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Hi,

    Thanks for your reply. I was hoping to change the ACL's without having to take ownership.

    Going to try and add this script to a logon script... hoping that as the user has full access rights, that they should be able to change permissions.

    If not will give your suggestion a go.

    Thank you once again!

  5. #4

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation

    Join Date
    Aug 2005
    Location
    London
    Posts
    2,810
    Blog Entries
    2
    Thank Post
    74
    Thanked 443 Times in 389 Posts
    Rep Power
    98

    Default

    If you're expecting the user running the script to be owner then it will do no harm to forcibly set the owner - if they're already owner, it makes no change.

    If they're not owner then you make them owner and allow the permissions change.

  6. #5

    Reputation

    Join Date
    Nov 2009
    Location
    Lymington
    Posts
    6
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Hi,

    I don't think you need the speech marks around Administrators.
    Below is a line from a script which works and I have deployed using a GPO.

    cacls "c:\Program Files\Sherston\Money Mice\saves" /e /g everyone:c

    Only the path is in speech marks.

    Hope that helps,
    Steve.
    Last edited by SteveCIS; 24-11-2009 at 04:22 PM.

  7. #6

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation

    Join Date
    Aug 2005
    Location
    London
    Posts
    2,810
    Blog Entries
    2
    Thank Post
    74
    Thanked 443 Times in 389 Posts
    Rep Power
    98

    Default

    Quote Originally Posted by SteveCIS View Post
    Hi,

    I don't think you need the speech marks around Administrators.
    Below is a line from a script which works and I have deployed using a GPO.

    cacls "c:\Program Files\Sherston\Money Mice\saves" /e /g everyone:c

    Only the path is in speech marks.
    You don't need them but it doesn't matter. If you wanted to do (say) domain users then you would need the quotes - I'd guess if you get into the habit of always using them then you won't miss them off when they are needed :-)

  8. #7

    Reputation Reputation Reputation Reputation Reputation Reputation
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,604
    Thank Post
    32
    Thanked 123 Times in 113 Posts
    Rep Power
    41

    Default

    Quote Originally Posted by srochford View Post
    You don't need them but it doesn't matter. If you wanted to do (say) domain users then you would need the quotes - I'd guess if you get into the habit of always using them then you won't miss them off when they are needed :-)
    or if your like me you never use spaces when your naming stuff if you can help it. This includes paths group names etc. Bloody spaces are more trouble than they are worth

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Photostory Access denied error.
    By ICT_GUY in forum Windows
    Replies: 20
    Last Post: 10-02-2010, 11:03 AM
  2. Access Denied - Backup Exec 12
    By Geek_of_HeathMount in forum Windows Server 2008
    Replies: 0
    Last Post: 21-10-2009, 01:14 PM
  3. RIS Access denied file in use
    By kevin_lane in forum Windows
    Replies: 0
    Last Post: 07-01-2009, 09:17 AM
  4. Access Denied from Admin Network
    By MrDylan in forum ICT KS3 SATS Tests
    Replies: 9
    Last Post: 25-04-2006, 12:09 PM

Posting Permissions

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