7

我有下面的脚本,它工作正常,但我如何设置它以保持安全设置并将额外的“人”添加到安全组......

...并且可以cacls更改文件夹的“所有者”吗?

我厌倦/e了编辑而不是替换,但由于某种原因它不喜欢它?

Set WshShell = CreateObject("WScript.Shell")
strFolder    = "D:\test"

setPerms     = "%COMSPEC% /c echo Y| C:\windows\system32\cacls.exe """ & _
                strFolder & """ /G mydomain\myusername:F & pause" 'added pause to see what the outcome is

WshShell.run setPerms
4

1 回答 1

16

CACLS已弃用,您可以使用推荐的ICACLS. 你想要这样的东西:

icacls.exe d:\test /grant domain\username:F

添加权限并:

icacls.exe d:\test /setowner domain\username

设置所有权。其他感兴趣的选项icacls /?

/T indicates that this operation is performed on all matching
    files/directories below the directories specified in the name.

/C indicates that this operation will continue on all file errors.
    Error messages will still be displayed.
于 2013-12-19T07:56:18.617 回答