具有文件夹权限的批处理文件命令

时间:2016-03-06 15:20:35

标签: batch-file

我遇到了这个批处理文件命令的问题。我想要一个特定的文件夹来访问用户和管理员,但没有其他人。该命令否认了所有人。

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)

)

0 个答案:

没有答案