本帖最后由 landays 于 2010-1-24 20:17 编辑
设置HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run的权限的确成功了
但该项目下的子项却并没有随之更改?#cs = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
; HKEY_CLASSES_ROOT - 0x80000000
; HKEY_CURRENT_USER - 0x80000001
; HKEY_LOCAL_MACHINE - 0x80000002
; HKEY_USERS - 0x80000003
; $aDacl = 只允许Administrators、System、Creator Owner三个用户的全部访问请求,其他用户的任意访问请求都将被拒绝。
; 0xF003F = 所有访问,0x20019 = 读取操作。
; 3 - 权限继承到子键。
; SET_ACCESS = 访问类型为“允许”,DENY_ACCESS = 访问类型为“拒绝”
#ce = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
#include <LocalSecurityAuthority.au3>
Local $aDacl[4][4] = [["BUILTIN\Administrators", 0x20019, $SET_ACCESS, 3], _
["NT AUTHORITY\System", 0x20019, $SET_ACCESS, 3], _
["CREATOR OWNER", 0x20019, $SET_ACCESS, 3], _
["everyone", 0x20019, $SET_ACCESS, 3]]
$fResult = _RegSetKeySecurityDacl(0x80000002, "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $aDacl)
Msgbox(0, $fResult, @error)
|