Question : Setting Folder Permission in Windows XP - VB Script

I'm trying to modify the permissions of folder to add a Domain/Group and grant them full access. I know how to this through the GUI, but I need to do this through a script. The folder permissions that need to be modified will be C:\Program Files\X

Any help would greatly be appreciated.

Thanks!

Answer : Setting Folder Permission in Windows XP - VB Script

add folder access
You change the parameters for calcs
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Dim strHomeFolder
Dim intRunError, objShell, objFSO 

 strHomeFolder = "C:\Program Files\X"       
   Set objShell = CreateObject("Wscript.Shell")
     Set objFSO = CreateObject("Scripting.FileSystemObject")
  If objFSO.FolderExists(strHomeFolder) Then
    intRunError = objShell.Run("%COMSPEC% /k cacls """ & strHomeFolder & """ /e /c /g everyone:F ", 2, True)
   
  End If 
Random Solutions  
 
programming4us programming4us