我遇到了这个批处理文件命令的问题。我想要一个特定的文件夹来访问用户和管理员,但没有其他人。该命令否认了所有人。
net use T: "\\sharedrive\Employee Documents\%USERNAME%"
md "\\sharedrive\Employee Documents\%USERNAME%"
@IF Exist "\\sharedrive\Employee Documents\%USERNAME%" (
icacls "\\sharedrive\Employee Documents\%USERNAME%" /inheritance: rw
icacls "\\sharedrive\Employee Documents\%USERNAME%" /DENY Everyone: (CI) (OI) (F)
ELSE IF icacls "\\sharedrive\Employee Documents\%USERNAME%" /GRANT "%USERNAME%: (CI) (OI) (F)
ELSE IF icacls "\\sharedrive\Employee Documents\%USERNAME%" /GRANT "Administrators: (CI) (OI) (F)
)