How to List Folder Permissions with vbscript

Posted on 2006-04-08
Last Modified: 2012-06-27
Hi All,

I need to do a vbcript program to list the permissions to an specific folder
on a 2003 server. I am a beginner vbscripter and could'nt find a sample fo
that anywhere else...

Any hint on how can I do that?

Thanks to all!
Question by:rosado
    LVL 28

    Assisted Solution

    LVL 6

    Assisted Solution

    ADsSecurity.dll is a great way to get permissions of a Windows folder. It requires downloading and registering it but using it in scripts is easy. There is some good documentation on how to use it to.

    Let me know if you need more information.
    LVL 3

    Accepted Solution

    Something like this might do the trick .....

    Dim wshShell
    Dim folderpath

    Set wshShell = CreateObject("WScript.Shell")

    folderpath = "C:\Windows\"
    wshShell.Run("CACLS " & folderpath & " > C:\dirperms.Txt")
    Should produce you a text file looking like....

               C:\WINDOWS BUILTIN\Users:R
               BUILTIN\Users:(OI)(CI)(IO)(special access:)

               BUILTIN\Power Users:C
               BUILTIN\Power Users:(OI)(CI)(IO)C
               NT AUTHORITY\SYSTEM:F
               NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
               CREATOR OWNER:(OI)(CI)(IO)F
    LVL 3

    Expert Comment

    Would suggest that since the user has not responded, I have provided a complete answer to their problem.

    However, I believe that the other experts have provided correct advice and assistance also and hence would suggest a points split as follows...

    WillEastbury  100 points
    vinnyd79       75 points
    tone28          75 points


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now