如何用p版的UDF对文件夹设只读权限呀
如何用p版的UDF对文件夹设只读权限呀 #include <lsasecur.au3>Const $FILE_READ = 0x120089 ; access mask of 'read only'
Const $sFilePath = "E:\test"
Local $pDacl = _SeInitAcl(64)
Local $pSecurityDescriptor = _SeInitSecurityDescriptor(40)
Local $pTrustee = _SeLookupAccountName("Everyone")
_SeSetSecurityDescriptorDacl($pSecurityDescriptor, $pDacl)
_SeAddAccessAllowedAceEx($pDacl, $pTrustee, $FILE_READ, 0)
If _SeSetFileSecurity($sFilePath, $SE_INFO_DACL, $pSecurityDescriptor) Then
MsgBox(0, "OK", "Done")
Else
MsgBox(48, "Failed", "error " & @error)
EndIf
_SeHeapFree($pTrustee)
_SeHeapFree($pDacl)
_SeHeapFree($pSecurityDescriptor) 谢谢p版了,还有很多东西不知道怎么搞了。
页:
[1]