+ Post New Thread
Results 1 to 13 of 13
Windows 7 Thread, iCacls on Windows 7 (modify permissons for Everyone user on file/folder) in Technical; In Windows XP I used to be able to do the following to change the permissions of a folder and ...
  1. #1
    darrenstraight's Avatar
    Join Date
    Feb 2009
    Posts
    36
    Thank Post
    2
    Thanked 2 Times in 2 Posts
    Rep Power
    12

    Question iCacls on Windows 7 (modify permissons for Everyone user on file/folder)

    In Windows XP I used to be able to do the following to change the permissions of a folder and its files inside by doing the following (must modify not remove any exsisting):

    Code:
    cacls "C:\Test" /e /c /g Everyone:F
    In Windows 7 I'm trying the following (in run cmd as Administrator):

    Code:
    Icacls "C:\Test" /grant Everyone:F
    But it just doesnt do anything (cant use /e switch says invalid)!!

    I tried using a domain username too:

    Code:
    Icacls "C:\Test" /grant DOMAINNAME\username:F
    But it just adds the user but with no ticks. I've tried various options as seen here: http://ss64.com/nt/icacls.html

    I'm starting to give up, need this to work so I can deploy a batch file to certain computers with Adobe Photoshop installed on Windows 7 and change the permissions of C:\ProgramData\Adobe\Photoshop Elements\5.0 to evryone so theres not a problem on first load - just like Game maker and it's softwrap errors, was hoping to do the same!!

    *Free virtual ice lolly and a pint for the one who can solve my problem - would send but it would melt and the beer would go warm hehe*

  2. #2
    ajs
    ajs is offline

    Join Date
    Jun 2008
    Location
    Wigton, Cumbria
    Posts
    226
    Thank Post
    2
    Thanked 35 Times in 35 Posts
    Rep Power
    23
    Have you tried using the :r switch after /grant?

    (Since the website you linked to suggests to me that its the equivalent of /e)

  3. #3
    darrenstraight's Avatar
    Join Date
    Feb 2009
    Posts
    36
    Thank Post
    2
    Thanked 2 Times in 2 Posts
    Rep Power
    12
    Quote Originally Posted by ajs View Post
    Have you tried using the :r switch after /grant?

    (Since the website you linked to suggests to me that its the equivalent of /e)
    No luck - also tried doing the following, which does stop inheritance and I can manually black tick/untick the boxed on the security tab:

    Code:
    Icacls "C:\Test" /inheritance:d
    But still no luck adding any user with full control or anything for that matter, it adds user but only has special permissions grey ticked.

  4. #4
    ajs
    ajs is offline

    Join Date
    Jun 2008
    Location
    Wigton, Cumbria
    Posts
    226
    Thank Post
    2
    Thanked 35 Times in 35 Posts
    Rep Power
    23
    What are the current permissions on the folder?

  5. #5
    darrenstraight's Avatar
    Join Date
    Feb 2009
    Posts
    36
    Thank Post
    2
    Thanked 2 Times in 2 Posts
    Rep Power
    12
    Interesting I was reading a comment on, someone else having problems with permissions on folders:
    iCACLS Vista Command Prompt Tool to Manage ACLs » My Digital Life

    And at the moment theres nothing in the test folder but I wonderd could I create a test.txt file and would permissions work on that, well I tried:

    Code:
    Icacls "C:\Test\test.txt" /grant Everyone:f
    Well it seems icacls is working for me on files but not folders!

    Permissions currently attached in image (after using Icacls "C:\Test" /inheritance:d)
    Attached Images Attached Images
    Last edited by darrenstraight; 9th July 2010 at 01:17 PM.

  6. #6
    ajs
    ajs is offline

    Join Date
    Jun 2008
    Location
    Wigton, Cumbria
    Posts
    226
    Thank Post
    2
    Thanked 35 Times in 35 Posts
    Rep Power
    23
    One of the comments on the site suggests that cacls is still around in Windows Vista. Presumably it's been removed entirely in Windows 7?

  7. Thanks to ajs from:

    darrenstraight (9th July 2010)

  8. #7
    darrenstraight's Avatar
    Join Date
    Feb 2009
    Posts
    36
    Thank Post
    2
    Thanked 2 Times in 2 Posts
    Rep Power
    12
    Quote Originally Posted by ajs View Post
    One of the comments on the site suggests that cacls is still around in Windows Vista. Presumably it's been removed entirely in Windows 7?
    I'm so confused!!

    I've just tried CACLS again and it now works!

    last time I tried it with commands it said "NOTE: Cacls is now deprecated, please use Icacls." and didnt work though that still comes up if I just type cacls in cmd, very confused - I'm going to try my batch files now and see if they work hopefuly they do!

    Thanks for all your help btw, really appreciated!
    Last edited by darrenstraight; 9th July 2010 at 01:53 PM.

  9. #8
    ajs
    ajs is offline

    Join Date
    Jun 2008
    Location
    Wigton, Cumbria
    Posts
    226
    Thank Post
    2
    Thanked 35 Times in 35 Posts
    Rep Power
    23
    Not a problem. Hope you get it sorted :-)

  10. #9

    Join Date
    Mar 2011
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Icacls "C:\Test\test.txt" /grant Everyone:f
    should be:
    icacls c:\test\test.ext /grant Everyone:(F)
    or
    icacls \\localhost\c$\test\test.ext /grant Everyone:(F)

    if the user or group name has a space in it, include it in quotes such as "Domain Admins" or "Enterprise Admins"
    icacls \\localhost\c$\test\test.ext /grant "Enterprise Admins":(F)
    Last edited by pmkochie; 3rd March 2011 at 12:27 AM. Reason: :( made a sad face and I need to put in :(

  11. #10

    Join Date
    May 2011
    Location
    Sydney
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I too had this problem where the security was applying to my files but not folders. Folders would display special security.

    I changed *.* to just * within the folder i wished to change. Using /T to made changes to all my subs. Here are my non working and working scripts.

    Wrong
    C:\test
    Icacls *.* /T /C /grant system:F

    Working
    c:\test
    Icacls * /T /C /grant system:F

    Hope this helps as it was doing my head in.

  12. #11

    Join Date
    May 2011
    Location
    Sydney
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Correction

    Here is the correct working script i used to apply to folders and files.

    icacls * /T /C /grant systemOI)(CI)F

  13. #12


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,055
    Thank Post
    231
    Thanked 2,716 Times in 2,004 Posts
    Rep Power
    794
    ^ Might be worth using CODE tags to avoid the smiley face problem.

    I normally use SetACL to reset permissions - unlike ICACLS it works with file and folder names longer than 260 characters.

  14. #13

    Join Date
    Dec 2011
    Location
    Ohio
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by defhead View Post
    Correction

    Here is the correct working script i used to apply to folders and files.

    icacls * /T /C /grant systemOI)(CI)F

    I too am scripting, a long time user of cacls, but confused as heck with icacls. They just got everything wrong with the docs: too much no one needs to do, and nothing you would need to do; I found many thing are undefined in docs: container, objects, sid, perm. They didn't take a single week to make the docs easier, while a billion people over the years will be lost at using this useful tool, over looking its power.

    I also have no windows7 machine to test my icacl bat So I don't know if there are y/n confirmations I need to overcome or what will work.

    I am distributing an few exes that do not need to extract on the fly anything. so I will be putting these exes in folder called toolbox that will not allow any file to be written to the folder toolbox.

    Do any of these lines work? Which can I use to lock for everyone, every account?

    title icaclsbat
    %SystemRoot%\system32\icacls.exe toolbox /grant:r AdministratorsOI)(CI)R
    %SystemRoot%\system32\icacls.exe toolbox /grant:r users(OI)(CI):R
    %SystemRoot%\system32\icacls.exe toolbox /grant:r system(OI)(CI):R


    cd toolbox


    %SystemRoot%\system32\icacls.exe * /T /C /grant:r systemOI)(CI)R


    : the frowny face is colon left parenthesis.

SHARE:
+ Post New Thread

Similar Threads

  1. [MS Office - 2007] Word says the file is locked by a user, but names the wrong user!
    By AngryTechnician in forum Office Software
    Replies: 10
    Last Post: 12th January 2012, 12:45 PM
  2. Replies: 3
    Last Post: 29th March 2010, 01:01 PM
  3. User Folder
    By stuartp44 in forum Windows 7
    Replies: 2
    Last Post: 20th January 2010, 11:39 AM
  4. Setting permissons on Userareas
    By Gonk in forum Wireless Networks
    Replies: 9
    Last Post: 11th September 2009, 08:34 AM
  5. Default User folder
    By Gavinc in forum Scripts
    Replies: 0
    Last Post: 2nd October 2008, 12:48 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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