title: How can I test effective permissions of a user from a batch script?
body: <p>I need to test the effective permissions of a <strong>specific user</strong> (i.e. not necessarily the current user) from within a batch script and take action (provide a warning) based on that.  I'd like to have a subroutine I could call to check privileges against a specified file or directory so I could test that something only an administrator should be able to access (and thus warn that too high of permissions are granted) and check that data directories in my apps path can be accessed (otherwise too low of permissions).  I'd like this to work in XP, 2008, and win7.</p>
  
  <p>By the way, I have figured out how to parse "net localgroup Administrators", but I don't think this is sufficient for my needs.</p>