use strict; use Win32::OLE qw(in with EVENTS); use Win32::OLE::Const; # # Start of script # # Create the SetACL object my $oSetACL = Win32::OLE->CreateObject ('SetACL.SetACLCtrl.1') or die "SetACL.ocx is not registered on your system! Use regsvr32.exe to register the control.\n"; # Load the constants from the type library my $const = Win32::OLE::Const->Load ($oSetACL) or die "Constants could not be loaded from the SetACL type library!\n"; # Enable event processing Win32::OLE->WithEvents ($oSetACL, \&EventHandler); # # Check arguments # my $Path = $ARGV[0] or die "Please specify the (file system) path to use as first parameter!\n"; my $Trustee = $ARGV[1] or die "Please specify the trustee (user/group) to use as second parameter!\n"; my $Permission = $ARGV[2] or die "Please specify the permission to set as third parameter!\n"; ... # Set the object my $RetCode = $oSetACL->SetObject ($Path, $const->{SE_FILE_OBJECT});