' VBScript ~ addACL.vbs
' Version: Draft 1
' Date: 20 August 2010
'---------------------------------------------------
On Error Resume Next
Dim fso
Dim WshNetwork
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = CreateObject("WScript.Network")
DomainString = WshNetwork.UserDomain
UserString = WshNetwork.UserName
'------------------------------------------------------------
' Add New Domain User to NTFS ACL of D:\UserFolder
'------------------------------------------------------------
If fso.FolderExists("D:\UserFolder") then
WshShell.run "cacls D:\UserFolder /G " & DomainString & "\" & UserString & ":F /C /E /T",0,true
End If
WScript.Quit
|