http://qs1969.pair.com?node_id=225827


in reply to Removing users from a directory

Have you looked at Win32::FileSecurity ?
# Gets existing DACL and modifies Administrator rights use Win32::FileSecurity qw(MakeMask Get Set); # These masks show up as Full Control in File Manager $file = MakeMask( qw( FULL ) ); $dir = MakeMask( qw( FULL GENERIC_ALL ) ); foreach( @ARGV ) { s/\\$//; next unless -e; Get( $_, \%hash ) ; $hash{Administrator} = ( -d ) ? $dir : $file ; Set( $_, \%hash ) ; }
Update: Oops, earthboundmisfit beat me :(