Jump to content

folder permission


Recommended Posts

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 )

 

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...