Granting write permission to files with icacls

Discussion in 'Scripting' started by sacarias, Oct 28, 2019.

  1. sacarias

    sacarias MDL Junior Member

    Nov 21, 2018
    65
    1
    0
    I have a couple of configuration files for a program; such files are located in a created subfolder inside %windir%.

    Right click -> Properties -> Security tab, and I see the files currently have read and execute permissions for the Users group. I need them to also have write permission, so I would just enable it in the checkbox (there's a warning when accepting changes).

    However I need to do this via command line, and that means icacls as far as I understand.

    I've never used icacls before, so what I tried is, "icacls <myfile>" to display its current ACLs, add write permission as per the paragraph above, then run again icacls command.
    Result: icacls output for my file was *not* different whatsoever.

    Why?
    So, how can I add write permissions to individual files for the Users builtin group?

    Thanks.

    P.S.: think this thread
    https://forums.mydigitallife.net/th...iexplorer-11-for-all-users-via-regedit.80488/
    should have been posted here in this sub-forum instead?
     
  2. Thomas Dubreuil

    Thomas Dubreuil MDL Senior Member

    Aug 29, 2017
    348
    577
    10
    to add simple write access to users group:
    Code:
    icacls "C:\path\file" /grant Users:(W)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...