PDA

View Full Version : Set File Access



NewsArchive
01-14-2014, 07:59 AM
Hi Friedrich,

how can I remove inherited rights from a folder with SetupBuilder?

Thanks for your answer.

Markus

NewsArchive
01-14-2014, 08:00 AM
Hi Markus,

>
> how can I remove inherited rights from a folder with SetupBuilder?
>

As far as I know, you can't control NTFS permissions inheritance
programmatically from the access rights component.

Friedrich

NewsArchive
01-14-2014, 08:00 AM
Not sure if Xcacls.exe can help in this case (don't know if it is allowed to
package it into a setup.exe; don't know if UAC-aware OSs are supported)

http://support.microsoft.com/kb/318754
http://support.microsoft.com/kb/822790

Friedrich

NewsArchive
01-14-2014, 11:48 AM
I will use the following AutoIT-Script (of course without hard coded paths):

#include 'Permissions.au3'
_InitiatePermissionResources()
Local $File = 'C:\ACLTest'
Local $aPerm[3][3]
$aPerm[0][0] = @UserName
$aPerm[0][1] = 1
$aPerm[0][2] = $GENERIC_ALL
$aPerm[1][0] = 'Administrators'
$aPerm[1][1] = 1
$aPerm[1][2] = $GENERIC_ALL
$aPerm[2][0] = 'System'
$aPerm[2][1] = 1
$aPerm[2][2] = $GENERIC_ALL
Local $ret = _SetObjectPermissions($File,$aPerm,$SE_FILE_OBJECT ,'',1,1,3)
_ClosePermissionResources()

Markus Zander