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});
-- Burvil
ActiveX is really designed to provide a way for languages like VisualBasic to get access to goodies. It's rather cumbersome compared to a "native" solution like Win32::Perms which hooks straight into the Windows API. Both should work but Win32::Perms ought be a lot faster with fewer dependencies.
H:\working_files\win32>xcacls G:\IG-S G:\IG-SSo I did a google search, and found this link and this link, in addition to this link at the Microsoft knowledgebase, which seem to point to the unreliability of xcalcs. Although the knowledgebase article says it's only for NT 4, we're running Win2k, with all the needed patches.(OI)(CI)C BUILTIN\Administrators:(OI)(CI)F DOMAIN1\Domain Admins:(OI)(CI)F AD-DOMAIN\LabOps Admins:(OI)(CI)F NT AUTHORITY\SYSTEM:(OI)(CI)F BUILTIN\Users:(CI)R
So maybe it's something wrong with the OS itself ...
-- Burvil
perlmonks.org content © perlmonks.org and bowei_99, displeaser, GrandFather
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03