Hi.  I've been working on this for a while. I think now it's good enough to post it here.  Functions to do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc.  Here's a good example to test:  #include 'Permissions.au3'
_InitiatePermissionResources()
FileWrite(@ScriptDir&'test.txt','Test')
Local $TI = TimerInit()
Local $ret = _DenyAllAccess(@ScriptDir&'test.txt',$SE_FILE_OBJECT,@UserName)
Local $TD =
	
			 
		 
		
			OK, I think I may have found your solution. Here's a new function that gets a Dacl containing all aces, including the inherited ones: 
 
 Func _GetObjectDaclIncludeInherit($oName, $_SE_OBJECT_TYPE = $SE_FILE_OBJECT)
Local $sSD = _GetObjectStringSecurityDescriptor($oName,$_SE_OBJECT_TYPE )
$sSD = StringReplace($sSD,'ID;',';')
Local $pSD = _ConvertStringSecurityDescriptorToSecurityDescriptor($sSD)
Return _GetSecurityDescriptorDacl($pSD)
EndFunc ;==> _GetObjectDaclIncludeInherit
 
Now, an import