icacls-无效参数错误

icacls-无效参数错误

使用 Server 2008 R2,我使用以下命令并且运行良好:

icacls “D:\wamp\apache” /grant “run_apache”:(OI)(CI)RX /T

然而,使用

icacls “D:\wamp\apache\logs” /grant “run_apache”:(OI)(CI)RWXD /T

导致此错误消息:

Invalid parameter “run_apache:(OI)(CI)RWXD”

你能告诉我它出了什么问题以及怎样修复它吗?

答案1

使用您的命令,我得到了同样的错误。但如果我将其改为使用,它RXWD就会RWXD起作用:

icacls "D:\wamp\apache\logs" /grant "run_apache":(OI)(CI)RXWD /T

之所以这样,是因为这是RXWD三个权限的组合RX++ 。WD

键入以下命令可以查看权限掩码icacls /?

ICACLS name [/grant[:r] Sid:perm[...]]
    /grant[:r] Sid:perm grants the specified user access rights. With :r,
        the permissions replace any previously granted explicit permissions.
        Without :r, the permissions are added to any previously granted
        explicit permissions.
    perm is a permission mask and can be specified in one of two forms:
        a sequence of simple rights:
                N - no access
                F - full access
                M - modify access
                RX - read and execute access
                R - read-only access
                W - write-only access
                D - delete access

相关内容