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

Jared
  • 1,887
  • 3
  • 20
  • 45
user837208
  • 2,487
  • 7
  • 37
  • 54

1 Answers1

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).

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Helge Klein
  • 8,829
  • 8
  • 51
  • 71
  • 1
    I'm looking for something native to OS - no third party tools. Thanks for suggestion though – user837208 Jul 29 '11 at 15:53
  • Is it possible using any Windows API calls? – user837208 Aug 03 '11 at 01:39
  • @HelgeKlein Your links to GetEffectiveRightsFromAcl and your Authz API example are links to the same page. I think that's a typo. – Jared Oct 20 '11 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."). – Helge Klein Oct 20 '11 at 19:26