P is for Practical | |
PerlMonks |
Set file permissions using Perl in Windows?by wilsond (Scribe) |
on Jan 10, 2009 at 16:39 UTC ( [id://735405]=perlquestion: print w/replies, xml ) | Need Help?? |
wilsond has asked for the wisdom of the Perl Monks concerning the following question: Edit: The cacls.exe command line utility included with Windows seems to work very well for me. It works in all of the Windows versions I've tested: Windows 2000, Windows XP, Windows Vista, and Windows 7. If you need a simple ACL update utility, you can just use it as it seems to reliably exist in all Windows versions at least as new as Win2k. Just be sure to use echo y| cacls.exe .... format ("y" touching the pipe) to use it in an automated fashion. How would one set file permissions in Windows? I've made an installer that installs a utility written in Perl and "compiled" with ActiveState's PDK. But, it seems, by default the files are "Power Users" writable as well as original installer user writable, which are bad in my case. I'd like to specifically say "System && Admin Group, no one else" writable. I'd even better like a specific file to be non-readable as well. All of this is in one directory within the "Program Files" dir. I've found Win32::Security::ACL, but it's mega-confusing. The extent of my real knowledge of Windows file ACLs is how to click the buttons in the Security tab. If it were going onto a few boxes, I'd just do that. But in my case, it's going on about 2,000 machines. edit: This case is in XP, but it will be going onto Win2k and Vista as well, though not as large quantity.
Back to
Seekers of Perl Wisdom
|
|