3

As per subject, is there a command or may be even a sample VBScript that I can use to calculate/read effective permission of a file in Windows XP and Windows Server 2003 OS? All I want is to be able to get same information as I see in "effective permission" tab of Security->Advanced option of a NTFS file.

Commands like calcs, icacls etc don't provide effective permission- they can list inherited permission but they don't calculate effective permission.

EDIT- Based upon below answer, it isn't really possible by means of using VB Script. I'll write a piece of code and then call it from VBScript

1 Answer 1

5

Sysinternals' AccessChk should do the trick.

There is no built-in tool for this task. And I seriously doubt that calculating the effective permissions from VBScript is possible.

Programmatically the effective permissions can be determined by calling the API function GetEffectiveRightsFromAcl or using the more modern Authz API (example, scroll down a little).

4
  • 1
    I'm looking for something native to OS - no third party tools. Thanks for suggestion though
    – user837208
    Commented Jul 29, 2011 at 15:53
  • Is it possible using any Windows API calls?
    – user837208
    Commented Aug 3, 2011 at 1:39
  • @HelgeKlein Your links to GetEffectiveRightsFromAcl and your Authz API example are links to the same page. I think that's a typo.
    – Jared
    Commented Oct 20, 2011 at 13:28
  • @Jared: It certainly looks like a typo, but the example for Authz is on the page where GetEffectiveRightsFromAcl is described ("The following example shows using Authz API to get effective access rights from an ACL."). Commented Oct 20, 2011 at 19:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.