/bundles/itninjaweb/img/Breadcrumb_cap_w.png
I am trying to create a custom action which will allow modify rights to regular users. I have the command line that i would like to use for this but would like to create a VB custom action. Can someone tell me how to modify the script & use that script in my custom action. Thanks in advance guys.

C:\WINDOWS\System32\cacls.exe "C:\Program Files\XYZ Client" /T /E /G BUILTIN\USERS:C
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
Firstly, why bother wrapping it in script? I know why *I* would (I have a class which uses the ADsSecurity object)

Secondly, CACLS is just another program. On the web, there must be millions of examples of scripts to run programs.
Answered 03/11/2011 by: VBScab
Red Belt

Please log in to comment
0

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 & " /t /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


Just replace group name.
Answered 03/14/2011 by: itolutions
Purple Belt

Please log in to comment
0
Option Explicit
Dim strHomeFolder, strHome, strUser
Dim intRunError, objShell, objFSO

strHomeFolder = "C:\Program Files\XYZ"

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 & " /t /c /g Users:F ", 2, True)
If intRunError <> 0 Then
Wscript.Echo "Error assigning permissions for user " _
& strUser & " to home folder " & strHomeFolder
End If
End If


I get "Error assigning permissions for user to home folder"
Answered 03/14/2011 by: chichora123
Fourth Degree Green Belt

Please log in to comment
0
Checked your script. Works for me.

if you are using Windows 7 try "Run as administrator" mode (Elevated mode).
Answered 03/14/2011 by: itolutions
Purple Belt

Please log in to comment