How to get to know the shared folder share/ntfs permissions by using vbscript?

This is another vbs script to find out the local computer for any shared folder. Please see the script contents,

   strComputer = "."
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService= objSWbemLocator.ConnectServer(".", "root\cimv2")
Set colShares = objWMIService.ExecQuery("Select * from Win32_Share Where Type=0")
For each objShare in colShares
    Wscript.Echo "Name: " & objShare.Name  & vbCrLf _
                       & "Path: " & objShare.Path & vbCrLf  _
                       & "Type: " & objShare.Type  & vbCrLf _
                       & "Allow Maximum: " & objShare.AllowMaximum & vbCrLf _
                       & "Maximum Allowed: " & objShare.MaximumAllowed & vbCrLf _
                       & "Caption: " & objShare.Caption  
Wscript.Echo "---------------------------------"

Using this script, I manage to get the list of shared folders. How about if I want to know the share/ntfs permissions of the shared folder, what should be added into the script?

Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun VermaakTechnical SpecialistCommented:
VBScript is not appropriate for this

Use SetACL to export the NTFS permissions. It can also do the share permissions
MichaelBalackAuthor Commented:
Hi Shaun,

Besides SetACL, can we use icacls? We do not allowed to use 3rd party tools according to company IT policy.
Shaun VermaakTechnical SpecialistCommented:
Backup (AKA save permission to a file)
icacls d:\data /save ntfsperms.txt /t /c

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MichaelBalackAuthor Commented:
Thanks for expert - Shaun, that's works
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
file sharing

From novice to tech pro — start learning today.