[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
第三条尝试改为
  1. Start /wait /b CMD /c SetACL -on "%ff%" -ot reg -actn mod -ace "n:Administrators;p:full"
复制代码

TOP

本帖最后由 buyiyang 于 2023-3-9 18:12 编辑

因为administrators的权限是继承而来的,所以无法更改,要先将权限改为显式权限然后才能更改
  1. SetACL -on "%ff%" -ot reg -actn setprot -op "dacl:p_c;sacl:p_c" -actn ace -ace "n:Administrators;p:full;m:set;i:so,sc"
复制代码
说明如下:
  1. Protection
  2. Controls the flag ‘allow inheritable permissions from the parent object to propagate to this object’:
  3. nc
  4. Do not change the current setting.
  5. np
  6. Object is not protected, i.e. inherits from parent.
  7. p_c
  8. Object is protected, ACEs from parent are copied.
  9. p_nc
  10. Object is protected, ACEs from parent are not copied
复制代码
1

评分人数

    • Shuye: 好办法!技术 + 1

TOP

回复 8# Shuye


    恢复
  1. SetACL -on "%ff%" -ot reg -actn setprot -op "dacl:np;sacl:np" -actn clear -clr "dacl,sacl"
复制代码
1

评分人数

TOP

你的新需求应该要先取消父项中Administrators的propagate
  1. SetACL -on "父项" -ot reg -actn setowner -ownr "n:Administrators" -actn ace -ace "n:Administrators;p:read;i:np"
  2. SetACL -on "%ff%" -ot reg -actn ace -ace "n:Administrators;p:full;m:grant;i:so,sc"
复制代码
恢复
  1. SetACL -on "父项" -ot reg -actn ace -ace "n:Administrators;p:read;i:so,sc" -actn rstchldrn -rst "dacl,sacl"
复制代码
1

评分人数

    • Shuye: 好办法!技术 + 1

TOP

回复 13# Shuye


    因为子项继承的主体无法修改或删除,要么直接禁用子项的从父项继承(取消子项的所有主体的继承关系),要么从父项修改每个主体的propagation

TOP

返回列表