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.


In reply to Set file permissions using Perl in Windows? by wilsond

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.