Sign in to follow this  
Followers 0
EndFunc

Using SetACL.exe to set share permissions

4 posts in this topic

Does anyone know how the format should be to make this work? It reads the path and username from an Ini file. But I can't get it to work when it gets to the permissions part. Am I using the SetACL.exe correctly? Is there a better way.

This was the guide.

http://setacl.sourceforge.net/html/examples.html

I tried

$ProcessAdd = IniReadSectionNames($QueueFile)
                    For $a = 1 To $ProcessAdd[0]
                    $aProcessAdd = IniReadSection($QueueFile, $ProcessAdd[$a])
                        For $p = 1 To $aProcessAdd[0][0]
                            MsgBox(0,0, $aProcessAdd[$p][1])
                            DirCreate($aProcessAdd[$p][1])
                            $Permissions = "setACL.exe -on '" & $aProcessAdd[$p][1] & "' -ot file -actn ace"
                            $sPermissions = " -ace 'n:domain\" & $aProcessAdd[$p][0] & ";p:full'"
                            RunWait(@ComSpec & " /c " & $Permissions & $sPermissions, "C:\", @SW_HIDE)
                        Next
                    Next

EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites



Does anyone know how the format should be to make this work? It reads the path and username from an Ini file. But I can't get it to work when it gets to the permissions part. Am I using the SetACL.exe correctly? Is there a better way.

This was the guide.

http://setacl.sourceforge.net/html/examples.html

I tried

$ProcessAdd = IniReadSectionNames($QueueFile)
                    For $a = 1 To $ProcessAdd[0]
                    $aProcessAdd = IniReadSection($QueueFile, $ProcessAdd[$a])
                        For $p = 1 To $aProcessAdd[0][0]
                            MsgBox(0,0, $aProcessAdd[$p][1])
                            DirCreate($aProcessAdd[$p][1])
                            $Permissions = "setACL.exe -on '" & $aProcessAdd[$p][1] & "' -ot file -actn ace"
                            $sPermissions = " -ace 'n:domain\" & $aProcessAdd[$p][0] & ";p:full'"
                            RunWait(@ComSpec & " /c " & $Permissions & $sPermissions, "C:\", @SW_HIDE)
                        Next
                    Next

EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

Ok found this

http://www.autoitscript.com/forum/index.ph...9&hl=setacl

But still can't get it to work below.

$ProcessAdd = IniReadSectionNames($QueueFile)
                    For $a = 1 To $ProcessAdd[0]
                    $aProcessAdd = IniReadSection($QueueFile, $ProcessAdd[$a])
                        For $p = 1 To $aProcessAdd[0][0]
                            MsgBox(0,0, $aProcessAdd[$p][1])
                            DirCreate($aProcessAdd[$p][1])
                            $Permissions = @ScriptDir & "\setACL.exe"
                            $Domain = "Domain\" & $aProcessAdd[$p][0]
                            $sPermissions = ' -on "' & $aProcessAdd[$p][1] & ' -ot file -actn ace -ace "n:' & $Domain  & ';p:full"'
                            RunWait($Permissions & $sPermissions)
                        Next
                    Next
Where is the closing double quote on your object name? Maybe: $sPermissions = ' -on "' & $aProcessAdd[$p][1] & '" -ot file -actn ace -ace "n:' & $Domain & ';p:full"'

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Where is the closing double quote on your object name? Maybe: $sPermissions = ' -on "' & $aProcessAdd[$p][1] & '" -ot file -actn ace -ace "n:' & $Domain & ';p:full"'

:)

Yes I found that, thank you also for point that out. It works now. :)

EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0