We help IT Professionals succeed at work.

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

Last Modified: 2019-01-10
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
Watch Question

Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2019

VBScript is not appropriate for this

Use SetACL to export the NTFS permissions. It can also do the share permissions
MichaelBalackSenior System Engineer


Hi Shaun,

Besides SetACL, can we use icacls? We do not allowed to use 3rd party tools according to company IT policy.
Senior Consultant
Awarded 2017
Distinguished Expert 2019
This one is on us!
(Get your first solution completely free - no credit card required)
MichaelBalackSenior System Engineer


Thanks for expert - Shaun, that's works

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.