Permissions of executable

Hello. I am trying to find a way to get the permissions of executable’s in a directory. I am able to get NTFS permissions for shares but I actually need them for the files in a specific directory. This is what I have for the shares

(if (name of operating system as lowercase contains “win2”) then (("[NTFS]: " & name of it, path of it,(account name of trustee of it & “: " & (”//") & (if (generic all permission of it) then “Full Control//” else (if (generic write permission of it) then “Modify//” else (if (generic read permission of it AND generic execute permission of it) then “Read & Execute//” else ((if (read permission of it) then “Read/” else “”)& (if (write permission of it) then “Write/” else “”)& (if (execute permission of it) then “Execute/” else “”) & (if (delete permission of it) then “Delete/” else “”) & (if (list permission of it) then “List/” else “”) & (if (append permission of it) then “Append/” else “”) & (if (write dac permission of it) then “Modify DACL/” else “”) & ("/")))))) of entries whose (account name of trustee of it is “Everyone”) of dacls of security descriptors of folders (paths of it)) of network shares whose (name of it does not contain “$”)) else nothings)