0

I want to change the user permissions of the folder C:\Program Files\MyProgram so that every user is allowed to write to that folder.

I am able to set the corresponding user rights manually within the windows explorer (no problem).
Because I have many computers I need to do that by a script.

runas /user:Administrator "cacls \"C:\Program Files\MyProgram\" /T /E /G Users:F"
did not work. It tells me that it is trying to run cacls as user Administrator, but I don't get any output message.

psexec -u Administrator -p MyAdminPassword cacls "C:\Program Files\MyProgram" /T /E /G Users:F
tells me cacls exited with error code 1332
For this code I found in the internet the error message No mapping between account names and security IDs was done, but I did not find any solution which worked.

UAC is disabled (I don't get any message. Before I also tried to put it on.)

How can I give my user / all users write access to the folder C:\Program Files\MyProgram?

1 Answers1

0

I would use icacls for this since cacls is now depreceated (Run it inside an elevated command prompt or runas):

takeown /f "C:\Program Files\My Program"
icacls "C:\Program Files\My Program" /grant Users:F
Wasif
  • 321
  • 2
  • 8