vbs scripting to list and add NTFS permissions
Posted: Thu Oct 03, 2013 10:51 am
I want to write a script to list the current NTFS permissions on the network share folders and then add new groups (multiple groups) to the network share folders.
But it didn't work, please help!!!
Set sh = CreateObject("WScript.Shell")
fldr = "\\servername\myshare"
group = "TA\admin"
rc = sh.Run("%COMSPEC% /c icacls """ & fldr & """ | find /i """ & group _
& """", 0, True)
If rc <> 0 Then sh.Run "icacls """ & fldr & """ /grant " & group & ":F"
But it didn't work, please help!!!
Set sh = CreateObject("WScript.Shell")
fldr = "\\servername\myshare"
group = "TA\admin"
rc = sh.Run("%COMSPEC% /c icacls """ & fldr & """ | find /i """ & group _
& """", 0, True)
If rc <> 0 Then sh.Run "icacls """ & fldr & """ /grant " & group & ":F"