+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, script of list network share permissions in Coding and Web Development; Is a script around to list network share permissions ? This script can add permissions to a folder but not ...
  1. #1

    Join Date
    Oct 2013
    Posts
    3
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Lightbulb script of list network share permissions

    Is a script around to list network share permissions ?
    This script can add permissions to a folder but not add permissions to the sub folder: Anyone know how to teak it to set permissions to the folder and sub folders and files.

    Option Explicit
    Dim strHomeFolder, strHome, strUser
    Dim intRunError, objShell, objFSO

    strHomeFolder = "\\grand\home\user"

    Set objShell = CreateObject("Wscript.Shell")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    If objFSO.FolderExists(strHomeFolder) Then
    ' Assign user permission to home folder.
    intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " _
    & strHomeFolder & " /e /c /g Administrators:F ", 2, True)
    If intRunError <> 0 Then
    Wscript.Echo "Error assigning permissions for user " _
    & strUser & " to home folder " & strHomeFolder
    End If
    End If

    WScript.Quit

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Add /T sorted

    Cacls - Modify Access Control List | SS64.com

    /T Search the pathname including all subfolders.

    Example: Give the Finance group Full Control of a folder and all sub folders
    CACLS c:\docs\work /E /T /C /G "FinanceUsers":F
    Steve

  3. Thanks to Steve21 from:

    ginger8990 (3rd October 2013)

  4. #3


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,776
    Thank Post
    223
    Thanked 2,633 Times in 1,940 Posts
    Rep Power
    780
    It's also worth mentioning that you should be using icacls instead of cacls.

  5. #4

    Dos_Box's Avatar
    Join Date
    Jun 2005
    Location
    Preston, Lancashire
    Posts
    9,855
    Thank Post
    583
    Thanked 2,162 Times in 987 Posts
    Blog Entries
    23
    Rep Power
    627
    Moving to scripts forum.

  6. #5

    Join Date
    Oct 2013
    Posts
    3
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Can you send me scripts forum link?

    icalcls and calcls can be used to add multiple groups to tons of network share folders ?

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 7
    Last Post: 3rd September 2012, 12:24 PM
  2. My Computer showing tonnes of network shares
    By howartp in forum Windows 7
    Replies: 8
    Last Post: 10th July 2012, 04:52 PM
  3. Replies: 1
    Last Post: 14th May 2012, 01:17 PM
  4. Bulk Change Of Share Permissions
    By nadger119 in forum Windows Server 2008 R2
    Replies: 6
    Last Post: 27th April 2012, 03:25 PM
  5. Replies: 4
    Last Post: 3rd August 2010, 11:05 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •