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