回复 4# ahwhnj
#include <lsasecur.au3>
Local $sFilePath, $pTrustee, $pDacl, $pSecur
$sFilePath = "test.x"
$pTrustee = _SeLookupAccountName("Everyone")
$pDacl = _SeSetEntriesInAcl1($pTrustee, $SE_GENERIC_ALL, $SE_DENY_ACCESS, $SE_NO_INHERITANCE)
$pSecur = _SeInitSecurityDescriptor()
_SeSetSecurityDescriptorDacl($pSecur, $pDacl)
If _SeSetFileSecurity($sFilePath, $SE_INFO_DACL, $pSecur) Then
MsgBox(48, "OK", _SeFormatMsg("", 0))
Else
MsgBox(48, "Error", _SeFormatMsg())
EndIf
_SeLocalFree($pDacl)
_SeHeapFree($pTrustee)
_SeHeapFree($pSecur)
|