hendrikhe

folder permission

3 posts in this topic

#1 ·  Posted

Hello,

I am trying to change folder permission (full, read and write: F) for current user´s Desktop.

Its working for the user "localadmin". But for some reason I am not able to grant this group permission: computerID\Administrators. 

Attached screenshot I added computerID\Administrators manually. With script it is not even listed

group.png

 

$UID = @ComputerName  & "\localadmin"
$UID2 = @ComputerName  & "\Administrators"
$perm = "F"

$dir2 = "\\" & @ComputerName  & "\d$\data\"& @UserName & '\' & "Desktop"
RunWait( 'CACLS "' & $dir2 & '" /E /G ' & $UID & ':' & $perm, "", @SW_HIDE )
RunWait( 'CACLS "' & $dir2 & '" /E /G ' & $UID2 & ':' & $perm, "", @SW_HIDE )

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

What does this tell you in the cmd windows that will stay open now:

$UID = @ComputerName  & "\localadmin"
$UID2 = @ComputerName  & "\Administrators"
$perm = "F"

$dir2 = "\\" & @ComputerName  & "\d$\data\"& @UserName & '\' & "Desktop"
RunWait( @Comspec & ' /k CACLS "' & $dir2 & '" /E /G ' & $UID & ':' & $perm, "")
RunWait( @Comspec & ' /k CACLS "' & $dir2 & '" /E /G ' & $UID2 & ':' & $perm, "" )

Any Errors?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I changed

$UID2 = @ComputerName  & "\Administrators"

to

$UID2 = "Administrators"

and it worked!

Edited by hendrikhe

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